-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomments.html
146 lines (137 loc) · 5.76 KB
/
comments.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{% if page.comments != false %}
{% if site.comments_provider != 'disqus' and site.lazy_load_disqus and site.disqus and site.disqus.username %}
<a href="#" class="show_disqus_comment" onclick="return false;">Show Disqus Comments</a>
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ site.url }}{{ page.url }}';
this.page.identifier = '{{ page.url }}';
this.page.title = '{{ page.title }}';
};
var disqus_loaded = false;
$(function() {
$('.show_disqus_comment').on('click', function() { /* DON'T EDIT BELOW THIS LINE */
$(this).html('加载中...');
var that = this;
if (!disqus_loaded) {
var d = document, s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
var shortname = '{{ site.disqus.username }}';
s.src = '//' + shortname + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
disqus_loaded = true;
}
$(that).remove();
})
})
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}
{% case site.comments_provider %}
{% when 'disqus' %}
{% if site.disqus and site.disqus.username %}
{% assign load_disqus = true %}
<!-- Disqus Protection, see https://github.com/mzlogin/mzlogin.github.io/issues/2 -->
{% if site.disqus.username == 'mzlogin' %}
{% assign load_disqus = false %}
{% if site.url contains 'mazhuang.org' %}
{% assign load_disqus = true %}
{% endif %}
{% endif %}
{% if load_disqus %}
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ site.url }}{{ page.url }}';
this.page.identifier = '{{ page.url }}';
this.page.title = '{{ page.title }}';
};
(function() { /* DON'T EDIT BELOW THIS LINE */
var d = document, s = d.createElement('script');
s.type = 'text/javascript';
s.async = true;
var shortname = '{{ site.disqus.username }}';
s.src = '//' + 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="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}
{% endif %}
{% when 'gitment' %}
<div id="container"></div>
<link rel="stylesheet" href="https://fastly.jsdelivr.net/gh/imsun.github.io/gitment/style/default.css">
<script src="https://fastly.jsdelivr.net/gh/imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
var gitment = new Gitment({
id: '{{ page.url | truncate: 50, '' }}',
owner: '{{ site.gitment.owner }}',
repo: '{{ site.gitment.repo }}',
oauth: {
client_id: '{{ site.gitment.oauth.client_id }}',
client_secret: '{{ site.gitment.oauth.client_secret }}',
},
});
gitment.render('container');
</script>
{% when 'gitalk' %}
<div id="gitalk-container"></div>
<!-- <link rel="stylesheet" href="https://fastly.jsdelivr.net/npm/gitalk@1/dist/gitalk.css"> -->
<link rel="stylesheet" href="{{ assets_base_url }}/assets/vendor/gitalk/gitalk.css">
<script src="https://fastly.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
var gitalk = new Gitalk({
id: '{{ page.url | truncate: 50, '' }}',
clientID: '{{ site.gitalk.clientID }}',
clientSecret: '{{ site.gitalk.clientSecret }}',
repo: '{{ site.gitalk.repo }}',
owner: '{{ site.gitalk.owner }}',
admin: ['{{ site.gitalk.owner }}'],
labels: ['gitment'],
perPage: 50,
});
gitalk.render('gitalk-container');
</script>
{% when 'utterances' %}
<script src="https://utteranc.es/client.js"
repo="{{ site.utterances.repo }}"
issue-term="title"
label="gitment"
theme="github-light"
crossorigin="anonymous"
async>
</script>
{% when 'beaudar' %}
<script src="https://beaudar.lipk.org/client.js"
repo="{{ site.beaudar.repo }}"
issue-term="title"
issue-label="{{ page.url | truncate: 50, '' }}"
label="gitment"
theme="github-light"
comment-order="desc"
input-position="top"
crossorigin="anonymous"
async>
</script>
{% when 'giscus' %}
<script src="https://giscus.app/client.js"
data-repo="{{ site.giscus.repo }}"
data-repo-id="{{ site.giscus.repo-id }}"
data-category="{{ site.giscus.category }}"
data-category-id="{{ site.giscus.category-id }}"
data-mapping="title"
data-strict="1"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="zh-CN"
data-loading="lazy"
crossorigin="anonymous"
async>
</script>
{% endcase %}
{% endif %}