-
Notifications
You must be signed in to change notification settings - Fork 0
/
disqus.html
44 lines (41 loc) · 1.67 KB
/
disqus.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{% assign comment_config = site.ksio.social.comment.disqus %}
{% if comment_config %}
{% if jekyll.environment == "production" %}
{% assign disqus_shortname = comment_config.shortname %}
{% else %}
{% assign disqus_shortname = "" %}
{% endif %}
<div id="disqus_thread"></div>
{% if comment_config.proxy %}
{% javascript ksio/vendors/disqusjs.min %}
<script>
var dsqjs = new DisqusJS({
shortname: '{{ disqus_shortname }}',
siteName: '{{ site.title | default: site.name }}',
identifier: '{{ page.url }}',
url: 'http:https://' + location.host + '{{ page.url }}',
title: '{{ page.title }}',
api: '{{ comment_config.proxy.endpoint }}',
apikey: '{{ comment_config.proxy.key }}',
admin: '{{ comment_config.username }}',
adminLabel: '{{ comment_config.label | default: "管理员" }}'
});
</script>
{% else %}
<script>
var disqus_config = function () {
this.page.url = 'http:https://' + location.host + '{{ page.url }}';
this.page.identifier = '{{ page.url }}';
this.page.title = '{{ page.title }}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = '//{{ disqus_shortname }}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="external ">comments powered by Disqus.</a></noscript>
<script id="dsq-count-scr" src="//{{ disqus_shortname }}.disqus.com/count.js" async></script>
{% endif %}
{% endif %}