jekyll-theme-h2o-ac 1.3.0 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/_config.yml +12 -17
  3. data/_data/collections.yml +2 -2
  4. data/_includes/{footer.html → layouts/footer.html} +9 -4
  5. data/_includes/{post-head.html → layouts/head.html} +36 -29
  6. data/_includes/{header.html → layouts/header.html} +24 -0
  7. data/_includes/layouts/metainfo.html +40 -0
  8. data/_includes/{paginate-article.html → layouts/paginate-article.html} +8 -1
  9. data/_includes/{paginate.html → layouts/paginate.html} +5 -5
  10. data/_includes/{sidebar.html → layouts/sidebar.html} +10 -9
  11. data/_includes/layouts/submenu.html +30 -0
  12. data/_includes/plugins/analytics/analytics.html +3 -0
  13. data/_includes/{analytics.html → plugins/analytics/google.html} +1 -2
  14. data/_includes/plugins/comments/comments_block.html +67 -0
  15. data/_includes/plugins/comments/comments_js.html +24 -0
  16. data/_includes/plugins/comments/disqus.html +19 -0
  17. data/_includes/plugins/comments/waline_css.html +3 -0
  18. data/_includes/plugins/comments/waline_js.html +14 -0
  19. data/_includes/plugins/i18n.html +32 -0
  20. data/_includes/plugins/markdown/fancybox_css.html +1 -0
  21. data/_includes/plugins/markdown/fancybox_js.html +24 -0
  22. data/_includes/plugins/markdown/hotkeys.html +31 -0
  23. data/_includes/plugins/markdown/markdown.html +7 -0
  24. data/_includes/plugins/markdown/mermaid_block.html +10 -0
  25. data/_includes/plugins/markdown/mermaid_js.html +12 -0
  26. data/_includes/plugins/markdown/prism_css.html +16 -0
  27. data/_includes/plugins/markdown/prism_js.html +3 -0
  28. data/_includes/{calendar.html → plugins/others/calendar_block.html} +1 -1
  29. data/_includes/plugins/others/calendar_css.html +3 -0
  30. data/_includes/plugins/others/calendar_js.html +8 -0
  31. data/_includes/plugins/others/social_block.html +5 -0
  32. data/_includes/plugins/others/social_css.html +1 -0
  33. data/_includes/plugins/others/social_js.html +15 -0
  34. data/_includes/plugins/search/docsearch_css.html +3 -0
  35. data/_includes/plugins/search/docsearch_js.html +19 -0
  36. data/_layouts/404.html +17 -0
  37. data/_layouts/archives.html +70 -65
  38. data/_layouts/blog.html +4 -10
  39. data/_layouts/categories.html +3 -1
  40. data/_layouts/default.html +64 -54
  41. data/_layouts/page.html +17 -87
  42. data/_layouts/post.html +145 -434
  43. data/_layouts/stats.html +32 -2
  44. data/_layouts/tags.html +2 -2
  45. data/assets/css/app.min.css +1 -1
  46. data/assets/css/app.min.css.map +1 -1
  47. data/assets/js/app.min.js +1 -1
  48. data/assets/js/app.min.js.map +1 -1
  49. metadata +42 -22
  50. data/_includes/comments.html +0 -53
  51. data/_includes/head.html +0 -51
  52. data/_includes/mermaid.html +0 -12
  53. data/_includes/submenu.html +0 -20
  54. data/_includes/waline.html +0 -3
  55. /data/_includes/{pageNav.html → layouts/pageNav.html} +0 -0
  56. /data/_includes/{toc.html → layouts/toc.html} +0 -0
  57. /data/_includes/{busuanzi.html → plugins/analytics/busuanzi.html} +0 -0
  58. /data/_includes/{umami.html → plugins/analytics/umami.html} +0 -0
  59. /data/_includes/{mathjax.html → plugins/markdown/mathjax.html} +0 -0
  60. /data/_includes/{pwa.html → plugins/others/pwa.html} +0 -0
  61. /data/_includes/{webpusher.html → plugins/others/webpusher.html} +0 -0
data/_layouts/post.html CHANGED
@@ -1,229 +1,181 @@
1
- <!DOCTYPE html>
2
- {% if post.lang %}
3
- <html lang="{{post.lang}}">
4
- {% else %}
5
- <html lang="{{site.default_lang}}">
6
- {% endif %}
7
- {% include post-head.html %}
1
+ ---
2
+ layout: default
3
+ type: post
4
+ ---
8
5
 
9
- {% if site.prism.line_numbers %}
10
- <body class="line-numbers" ontouchstart="">
11
- {% else %}
12
- <body ontouchstart="">
13
- {% endif %}
14
6
  {% assign lang = page.lang | default: site.default_lang %}
15
7
  {% assign locales = site.data.locales[lang] %}
16
8
  {% assign post = locales.post %}
17
- <!--[if lt IE 10]>
18
- <div class="alert-danger" role="alert">你的浏览器实在太太太旧了,放学别走,升级完浏览器再说!<a target="_blank" class="alert-link" href="http://browsehappy.com">立即升级</a></div>
19
- <![endif]-->
20
- {% if site.gray %}
21
- <div id=all class="post gray" data-theme="{{ site.theme-color }}">
22
- {% else %}
23
- <div id="all" class="post" data-theme="{{ site.theme-color }}">
24
- {% endif %}
25
- <div class="alert-tip" id="no-previous">
26
- {{ post.tips.left }}
27
- </div>
28
- <div class="alert-tip" id="no-next">
29
- {{ post.tips.right }}
30
- </div>
31
- <input id="nm-switch" type="hidden" value="{{ site.nightMode }}"> {% include header.html %}
32
-
33
- <header
34
- class="g-banner post-header {{ site.postPatterns | prepend: 'post-pattern-' }} {{ site.theme-color | prepend: 'bgcolor-' }} {% unless page.cover %}post-no-cover{% endunless %}"
35
- data-theme="{{ site.theme-color }}"
36
- >
37
- <div class="post-wrapper">
9
+ <div class="g-banner post-header {{ site.postPatterns | prepend: 'post-pattern-' }} {{ site.theme-color | prepend: 'bgcolor-' }} {% unless page.cover %}post-no-cover{% endunless %}"
10
+ data-theme="{{ site.theme-color }}">
11
+ <div class="post-wrapper">
38
12
  <div class="post-tags">
39
- {% if page.tags.size > 0 %}
40
- {% for tag in page.tags %}
41
- <a href="{{ "/tags.html#" | append: tag | relative_url }}" class="post-tag">{{ tag }}</a>
13
+ {% if page.tags.size > 0 %}
14
+ {% for tag in page.tags %}
15
+ <a href="{{ " /tags.html#" | append: tag | relative_url }}" class="post-tag">{{ tag }}</a>
42
16
  {% endfor %}
43
- {% endif %}
17
+ {% endif %}
44
18
  </div>
45
19
  <h1>{{ page.title }}</h1>
46
20
  <div class="post-meta">
47
- <span class="post-meta-item">
48
- <svg class="icon" aria-hidden="true">
49
- <use xlink:href="#icon-user"></use>
50
- </svg>
51
- {% if page.author %}{{ page.author }}{% else %}{{ site.author }}{% endif %}
52
- </span>
53
- <time class="post-meta-item" datetime="{{ page.date | date:"%y-%m-%d" }}">
54
- <svg class="icon" aria-hidden="true">
55
- <use xlink:href="#icon-calendar"></use>
56
- </svg>
57
- <span class="create-at"></span>
58
- </time>
59
- <time class="post-meta-item" datetime="{{ page.date | date:"%y-%m-%d" }}">
60
- <svg class="icon" aria-hidden="true">
61
- <use xlink:href="#icon-update"></use>
62
- </svg>
63
- <span class="update-at"></span>
64
- </time>
65
21
  <span class="post-meta-item">
66
- <svg class="icon words" aria-hidden="true">
67
- <use xlink:href="#icon-words"></use>
68
- </svg>
69
- {% assign total_size = page.content | strip_html | strip_newlines | remove: " " | size %}
70
- {{ post.cover.total.info }} {% if total_size < 1000 %} {{ total_size }} {% else %} {{ total_size | divided_by: 1000.0 | round: 1 }}k {% endif %} {{ post.cover.total.unit }}
71
- </span>
72
- <span class="post-meta-item">
73
- <svg class="icon time" aria-hidden="true">
74
- <use xlink:href="#icon-time"></use>
75
- </svg>
76
- {{ post.cover.time.info }} {{ page.content | strip_html | strip_newlines | remove: " " | size | divided_by: 350 | plus: 1 }} {{ post.cover.time.unit }}
22
+ <svg class="icon" aria-hidden="true">
23
+ <use xlink:href="#icon-user"></use>
24
+ </svg>
25
+ {% if page.author %}{{ page.author }}{% else %}{{ site.author }}{% endif %}
77
26
  </span>
78
- {% if site.busuanzi %}
79
- <span class="post-meta-item">
80
- <svg class="icon pv" aria-hidden="true">
81
- <use xlink:href="#icon-pv"></use>
27
+ <time class="post-meta-item" datetime="{{ page.date | date:" %y-%m-%d" }}">
28
+ <svg class="icon" aria-hidden="true">
29
+ <use xlink:href="#icon-calendar"></use>
82
30
  </svg>
83
- {{ post.cover.view.info }} <span id="busuanzi_value_page_pv"></span> {{ post.cover.view.unit }}
84
- </span>
85
- {% endif %}
86
- {% if page.cover_author %}
31
+ <span class="create-at"></span>
32
+ </time>
33
+ <time class="post-meta-item" datetime="{{ page.date | date:" %y-%m-%d" }}">
34
+ <svg class="icon" aria-hidden="true">
35
+ <use xlink:href="#icon-update"></use>
36
+ </svg>
37
+ <span class="update-at"></span>
38
+ </time>
87
39
  <span class="post-meta-item">
88
- <svg class="icon" aria-hidden="true">
89
- <use xlink:href="#icon-image"></use>
90
- </svg>
91
- {% if page.cover_author_link %}
92
- {{ locales.cover }} <a href="{{ page.cover_author_link }}" target="_blank">{{ page.cover_author }}</a>
93
- {% else %}
94
- {{ locales.cover }} {{ page.cover_author }}
95
- {% endif %}
96
- </span>
97
- {% endif %}
40
+ <svg class="icon words" aria-hidden="true">
41
+ <use xlink:href="#icon-words"></use>
42
+ </svg>
43
+ {% assign total_size = page.content | strip_html | strip_newlines | remove: " " | size %}
44
+ {{ post.cover.total.info }} {% if total_size < 1000 %} {{ total_size }} {% else %} {{ total_size |
45
+ divided_by: 1000.0 | round: 1 }}k {% endif %} {{ post.cover.total.unit }} </span>
46
+ <span class="post-meta-item">
47
+ <svg class="icon time" aria-hidden="true">
48
+ <use xlink:href="#icon-time"></use>
49
+ </svg>
50
+ {{ post.cover.time.info }} {{ page.content | strip_html | strip_newlines | remove: " " | size |
51
+ divided_by: 350 | plus: 1 }} {{ post.cover.time.unit }}
52
+ </span>
53
+ {% if site.busuanzi %}
54
+ <span class="post-meta-item">
55
+ <svg class="icon pv" aria-hidden="true">
56
+ <use xlink:href="#icon-pv"></use>
57
+ </svg>
58
+ {{ post.cover.view.info }} <span id="busuanzi_value_page_pv"></span> {{ post.cover.view.unit }}
59
+ </span>
60
+ {% endif %}
61
+ {% if page.cover_author %}
62
+ <span class="post-meta-item">
63
+ <svg class="icon" aria-hidden="true">
64
+ <use xlink:href="#icon-image"></use>
65
+ </svg>
66
+ {% if page.cover_author_link %}
67
+ {{ locales.cover }} <a href="{{ page.cover_author_link }}" target="_blank">{{ page.cover_author
68
+ }}</a>
69
+ {% else %}
70
+ {{ locales.cover }} {{ page.cover_author }}
71
+ {% endif %}
72
+ </span>
73
+ {% endif %}
98
74
  </div>
99
- </div>
100
- {% if page.cover %}
101
- <div class="filter"></div>
102
- <div class="post-cover" style="background: url('{{ page.cover | relative_url }}') center no-repeat; background-size: cover;"></div>
103
- {% endif %}
104
- </header>
105
- <div class="post-content visible">
106
- {% if page.subtitle %}
107
- <h2 class="post-subtitle">{{ page.subtitle }}</h2>
108
- {% endif %}
109
-
110
- {% assign copyright = post.copyright %}
111
-
112
- <div class="container">
113
- {% include submenu.html %}
75
+ </div>
76
+ {% if page.cover %}
77
+ <div class="filter"></div>
78
+ <div class="post-cover"
79
+ style="background: url('{{ page.cover | relative_url }}') center no-repeat; background-size: cover;"></div>
80
+ {% endif %}
81
+ </div>
82
+
83
+ <main class="post-content visible">
84
+ {% if page.subtitle %}
85
+ <h2 class="post-subtitle">{{ page.subtitle }}</h2>
86
+ {% endif %}
87
+
88
+ {% assign copyright = post.copyright %}
89
+
90
+ <div class="container">
91
+ {% include layouts/submenu.html %}
114
92
  <div class="contents">
115
- <article class="markdown-body post">
116
- {% if page.langs %}
117
- <p><b>{{ locales.langs }}</b>
118
- {% assign langs = "zh-Hans, zh-Hant, en, ja" | split: ", " %}
119
- {% assign langnames = "简中, 繁中, EN, 日本語" | split: ", " %}
120
- {% if lang == site.default_lang %}
121
- {% assign url = page.url %}
122
- {% else %}
123
- {% assign urls = page.url | split: '/' %}
124
- {% assign url = "" %}
125
- {% for u in urls offset:2 %}
126
- {% assign url = url | append: "/" | append: u %}
127
- {% endfor %}
128
- {% endif %}
129
- {% for l in page.langs %}
130
- {% for i in (0..4) %}
131
- {% if langs[i] == l %}
132
- {% if l == page.lang %}
133
- {{ langnames[i] }}
134
- {% elsif l == site.default_lang %}
135
- <a href="{{ url }}">{{ langnames[i] }}</a>
136
- {% else %}
137
- {% assign prefix = "/" | append: l %}
138
- <a href="{{ url | prepend: prefix }}">{{ langnames[i] }}</a>
139
- {% endif %}
140
- {% endif %}
141
- {% endfor %}
142
- {% endfor %}
143
- </p>
144
- {% endif %}
145
- {{ page.content | extlinks }}
146
- <div class="post-copyright">
147
- <p>
148
- <span>{{ copyright.statement.name }}:</span>
149
- {{ copyright.statement.left }}
150
- <a href="{{ site.url }}" class="cplink">{{ site.title }}</a>
151
- {{ copyright.statement.middle }}
152
- </p>
153
- {% if site.cclicense %}
154
- <p>
155
- {{ copyright.statement.right1 }}
156
- <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" class="extlinks">CC BY-NC-SA 4.0</a>
157
- {{ copyright.statement.right2 }}
158
- </p>
159
- {% endif %}
160
- <p><span>{{ copyright.title }}:</span>《 {{ page.title }} 》</p>
161
- <p><span>{{ copyright.link }}:</span><a href="{{ page.url | prepend: site.url }}" class="cplink">{{ page.url | prepend: site.url }}</a></p>
162
- <p class="tips">{{ copyright.statement.outdate1 }} <span></span> {{ copyright.statement.outdate2 }}</p>
163
- </div>
164
- </article>
165
- </div>
166
- {% if page.content contains 'h1' or page.content contains 'h2' or page.content contains 'h3' or page.content contains 'h4' or page.content contains 'h5' or page.content contains 'h6' and site.toc %}
167
- <div class="table-of-contents">
168
- <h2>{{ post.outline }}</h2>
169
- {% include toc.html html=content %}
93
+ <article class="markdown-body post">
94
+ {% include plugins/i18n.html %}
95
+ {{ page.content | extlinks }}
96
+ <div class="post-copyright">
97
+ <p>
98
+ <span>{{ copyright.statement.name }}:</span>
99
+ {{ copyright.statement.left }}
100
+ <a href="{{ site.url }}" class="cplink">{{ site.title }}</a>
101
+ {{ copyright.statement.middle }}
102
+ </p>
103
+ {% if site.cclicense %}
104
+ <p>
105
+ {{ copyright.statement.right1 }}
106
+ <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" class="extlinks">CC
107
+ BY-NC-SA 4.0</a>
108
+ {{ copyright.statement.right2 }}
109
+ </p>
110
+ {% endif %}
111
+ <p><span>{{ copyright.title }}:</span>《 {{ page.title }} 》</p>
112
+ <p><span>{{ copyright.link }}:</span><a href="{{ page.url | prepend: site.url }}" class="cplink">{{
113
+ page.url | prepend: site.url }}</a></p>
114
+ <p class="tips">{{ copyright.statement.outdate1 }} <span></span> {{ copyright.statement.outdate2 }}
115
+ </p>
116
+ </div>
117
+ </article>
118
+ </div>
119
+ {% if page.content contains 'h1' or page.content contains 'h2' or page.content contains 'h3' or page.content
120
+ contains 'h4' or page.content contains 'h5' or page.content contains 'h6' and site.toc %}
121
+ <div class="table-of-contents">
122
+ <div class="toc-header"><h2>{{ post.outline }}</h2></div>
123
+ <div class="toc-body">
124
+ {% include layouts/toc.html html=content %}
125
+ </div>
170
126
  {% else %}
171
- <div class="table-of-contents hidden">
127
+ <div class="table-of-contents hidden">
172
128
  {% endif %}
129
+ </div>
173
130
  </div>
174
- </div>
131
+ {% include plugins/others/social_block.html %}
132
+ </main>
175
133
 
176
- {% if site.social-share %}
177
- <div class="social-share-wrapper">
178
- <div class="social-share"></div>
179
- </div>
180
- {% endif %}
181
- </div>
182
-
183
- <section class="author-detail">
184
- <section class="post-footer-item author-card">
134
+ <section class="author-detail">
135
+ <section class="post-footer-item author-card">
185
136
  <div class="avatar">
186
- <img src="{{ site.avatar | relative_url }}" alt="">
137
+ <img src="{{ site.avatar | relative_url }}" alt="">
187
138
  </div>
188
139
  <div class="author-name" rel="author">{{ site.author }}</div>
189
140
  <div class="bio">
190
- <p>{{ site.bio }}</p>
141
+ <p>{{ site.bio }}</p>
191
142
  </div>
192
143
  {% if site.sns.size > 0 %}
193
144
  <ul class="sns-links">
194
- {% for s in site.sns %}
195
- <li>
196
- <a href="{{ s[1] }}" target="_blank" aria-label="{{ s[0] }}">
197
- <svg class="icon" aria-hidden="true">
198
- <use xlink:href="#icon-{{ s[0] }}"></use>
199
- </svg>
200
- </a>
201
- </li>
202
- {% endfor %}
145
+ {% for s in site.sns %}
146
+ <li>
147
+ <a href="{{ s[1] }}" target="_blank" aria-label="{{ s[0] }}">
148
+ <svg class="icon" aria-hidden="true">
149
+ <use xlink:href="#icon-{{ s[0] }}"></use>
150
+ </svg>
151
+ </a>
152
+ </li>
153
+ {% endfor %}
203
154
  </ul>
204
155
  {% endif %}
205
- </section>
206
- <section class="post-footer-item read-next">
156
+ </section>
157
+ <section class="post-footer-item read-next">
207
158
  {% if page.next.url %}
208
159
  <div class="read-next-item">
209
- <a href="{{ page.next.url | relative_url }}" class="read-next-link" aria-label="{{ page.next.title }}"></a>
210
- <section>
211
- <span>{{ page.next.title }}</span>
212
- <p>{{ page.next.excerpt | strip_html | strip_newlines | truncate: 60}}</p>
213
- </section>
214
- {% if page.next.cover %}
215
- <div class="filter"></div>
216
- <img src="{{ page.next.cover | relative_url }}" alt="">
217
- {% endif %}
218
- </div>
160
+ <a href="{{ page.next.url | relative_url }}" class="read-next-link" aria-label="{{ page.next.title }}"></a>
161
+ <section>
162
+ <span>{{ page.next.title }}</span>
163
+ <p>{{ page.next.excerpt | strip_html | strip_newlines | truncate: 60}}</p>
164
+ </section>
165
+ {% if page.next.cover %}
166
+ <div class="filter"></div>
167
+ <img src="{{ page.next.cover | relative_url }}" alt="">
168
+ {% endif %}
169
+ </div>
219
170
  {% endif %}
220
171
 
221
172
  {% if page.previous.url %}
222
173
  <div class="read-next-item">
223
- <a href="{{ page.previous.url | relative_url }}" class="read-next-link" aria-label="{{ page.previous.title }}"></a>
174
+ <a href="{{ page.previous.url | relative_url }}" class="read-next-link"
175
+ aria-label="{{ page.previous.title }}"></a>
224
176
  <section>
225
- <span>{{ page.previous.title }}</span>
226
- <p>{{ page.previous.excerpt | strip_html | strip_newlines | truncate: 60}}</p>
177
+ <span>{{ page.previous.title }}</span>
178
+ <p>{{ page.previous.excerpt | strip_html | strip_newlines | truncate: 60}}</p>
227
179
  </section>
228
180
  {% if page.previous.cover %}
229
181
  <div class="filter"></div>
@@ -231,247 +183,6 @@
231
183
  {% endif %}
232
184
  </div>
233
185
  {% endif %}
234
- </section>
235
- {% if site.comments.disqus or site.comments.waline %}
236
- <section class="post-footer-item comment">
237
- <div class="comments-headline">
238
- <svg class="icon" aria-hidden="true">
239
- <use xlink:href="#icon-comment"></use>
240
- </svg>
241
- <span>{{ locales.post.comment }}</span>
242
- </div>
243
- {% if site.comments.disqus and site.comments.waline %}
244
- <div id="comments-switch">
245
- <span class="first-comment">Disqus</span>
246
- <span class="switch-button">
247
- <input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
248
- <label for="cmn-toggle-4"></label>
249
- </span>
250
- <span class="second-comment">Waline</span>
251
- </div>
252
- {% endif %}
253
- </section>
254
- {% endif %}
255
-
256
- {% if site.comments.disqus %}
257
- <section class="post-footer-item comment">
258
- <div id="disqus_thread"></div>
259
- </section>
260
- {% endif %}
261
-
262
- {% if site.comments.waline %}
263
- <section class="post-footer-item comment">
264
- <div id="waline"></div>
265
- </section>
266
- {% endif %}
267
186
  </section>
268
-
269
- {% include footer.html %}
270
- {% if page.mermaid or site.mermaid %}
271
- <div class="modal">
272
- <div class="modal-content">
273
- <header>
274
- <span class="close">&times;</span>
275
- </header>
276
- <div class="container"></div>
277
- </div>
278
- </div>
279
- {% endif%}
280
- </div>
281
-
282
- <script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
283
- <script>
284
- socialShare('.social-share', {
285
- sites: [
286
- {% for i in site.social-share-items %}
287
- '{{ i }}'
288
- {% if forloop.last == false %},
289
- {% endif %}
290
- {% endfor %}
291
- ],
292
- wechatQrcodeTitle: "分享到微信朋友圈",
293
- wechatQrcodeHelper: '<p>扫码后点击右上角</p><p>将本文分享至朋友圈</p>'
294
- });
295
- $("a.social-share-icon").each(function() {
296
- $(this).attr("aria-label", $(this).attr("class").split(' ')[1])
297
- });
298
- </script>
299
-
300
- {% if site.comments.disqus %}
301
- <script>
302
- /**
303
- * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
304
- * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
305
- /*
306
- var disqus_config = function () {
307
- this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
308
- this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
309
- };
310
- */
311
- (function() { // DON'T EDIT BELOW THIS LINE
312
- var d = document, s = d.createElement('script');
313
- s.src = '{{ site.comments.disqus_url }}';
314
- s.setAttribute('data-timestamp', +new Date());
315
- (d.head || d.body).appendChild(s);
316
- })();
317
-
318
- </script>
319
- {% endif %}
320
-
321
- <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
322
- <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
323
- <script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
324
- <script src="{{ "/assets/js/app.min.js" | relative_url }}"></script>
325
- <script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.min.js"></script>
326
- <script src="https://cdn.jsdelivr.net/npm/clipboard/dist/clipboard.min.js"></script>
327
- <script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script>
328
- {% include waline.html %}
329
- <script src="https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js" async></script>
330
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/dayjs.min.js"></script>
331
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/customParseFormat.js"></script>
332
- <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/relativeTime.js"></script>
333
- <script>
334
- /**
335
- * Better Scroll Experience
336
- */
337
- function scrollToAdjust(id){
338
- var element = document.getElementById(id);
339
- var headerOffset = 90;
340
- var elementPosition = element.getBoundingClientRect().top;
341
- var offsetPosition = elementPosition + window.scrollY - headerOffset;
342
- window.scrollTo({
343
- top: offsetPosition,
344
- behavior: "smooth"
345
- });
346
- }
347
- // 给图片添加链接
348
- $(document).ready(function() {
349
- var baseurl = $("meta[property='og:baseurl']").attr('content');
350
- $("p img").each(function() {
351
- $(this).attr('data-src', $(this).attr('src')).removeAttr('src').addClass("lazyload").attr('src', baseurl + '/assets/img/loading.gif');
352
- var strA = "<a data-fancybox='gallery' ref='gallery' href='" + $(this).attr('data-src') + "' data-caption='" + $(this).attr('alt') + "'></a>";
353
- $(this).wrapAll(strA);
354
- var caption = $(this)[0].alt;
355
- $(this).parent().after('<span class="caption">' + caption + '</span>');
356
- });
357
-
358
- Fancybox.bind('[data-fancybox]', {
359
- on: {
360
- load: (fancybox, slide) => {
361
- var gray = $("meta[property='og:gray']").attr('content');
362
- if(gray == "true"){
363
- $(".fancybox__content img").addClass("gray");
364
- $(".carousel__track .fancybox__thumb").addClass("gray");
365
- }
366
- }
367
- }
368
- });
369
-
370
- {% if site.comments.waline %}
371
- Waline.init({
372
- el: '#waline',
373
- serverURL: '{{ site.comments.waline_url }}',
374
- reaction: {{ site.comments.waline_reaction }},
375
- comment: true,
376
- locale: {{ site.comments.waline_locale }}
377
- });
378
- {% endif %}
379
-
380
- if($("#comments-switch").length > 0){
381
- var comment_status = $("#cmn-toggle-4")[0].checked;
382
- if(comment_status){
383
- $("#waline").addClass("active");
384
- }else {
385
- $("#disqus_thread").addClass("active");
386
- }
387
- $("#cmn-toggle-4").click(function(){
388
- $("#disqus_thread").toggleClass("active");
389
- $("#waline").toggleClass("active");
390
- })
391
- }else {
392
- if($("#disqus_thread").length > 0) {
393
- $("#disqus_thread").addClass("active");
394
- }else if($("#waline").length > 0) {
395
- $("#waline").addClass("active");
396
- }
397
- }
398
-
399
- var time_formats = ['YYYY-MM-DD HH:mm:ss ZZ', 'YYYY DD MMM HH:mm:ss ZZ', 'YYYY年MM月DD日 HH:mm:ss ZZ'];
400
- function dateFormat(date, format){
401
- var date_org = dayjs(date, time_formats[format]);
402
- var date = date_org.format(time_formats[format]);
403
- return {"date_org": date_org, "date": date}
404
- }
405
-
406
- dayjs.extend(window.dayjs_plugin_customParseFormat);
407
- dayjs.extend(window.dayjs_plugin_relativeTime);
408
- var post_date = $("meta[property='post-date']").attr('content');
409
- var post_date_format = $("meta[property='post-date-format']").attr('content');
410
- var local_post_date = dateFormat(post_date, post_date_format);
411
-
412
- $(".post time span.create-at").html(local_post_date["date"]);
413
-
414
- fetch("https://api.github.com/repos/{{ site.github.owner }}/{{ site.github.repository }}/commits?path={{ page.path }}")
415
- .then((response) => {
416
- return response.json();
417
- })
418
- .then((commits) => {
419
- if(commits.length != 0){
420
- var update_at = dayjs(commits[0]['commit']['committer']['date']);
421
- }else {
422
- var update_at = post_date
423
- }
424
-
425
- var local_update_at = dateFormat(update_at, post_date_format);
426
- $('.post time span.update-at').html(local_update_at["date"]);
427
-
428
- var relative_time = dayjs().diff(local_update_at["date_org"], 'day');
429
- $(".post-copyright .tips span").append(relative_time);
430
- if(relative_time > 365){
431
- $(".post-copyright .tips").addClass("active");
432
- }
433
- });
434
-
435
- /*
436
- * Keyboard shortcut bind: left and right
437
- */
438
-
439
- var previous_url = $("meta[property='og:previous_url']").attr('content');
440
- var next_url = $("meta[property='og:next_url']").attr('content');
441
-
442
- hotkeys('left', function(event, handler){
443
- // Prevent the default refresh event under WINDOWS system
444
- event.preventDefault();
445
- if(previous_url){
446
- console.log('you pressed left!');
447
- window.location.href = previous_url;
448
- }else {
449
- $("#no-previous").addClass("active");
450
- setTimeout(function(){$("#no-previous").removeClass("active");}, 1500);
451
- }
452
- });
453
-
454
- hotkeys('right', function(event, handler){
455
- // Prevent the default refresh event under WINDOWS system
456
- event.preventDefault();
457
- if(next_url){
458
- console.log('you pressed right!');
459
- window.location.href = next_url;
460
- }else {
461
- $("#no-next").addClass("active");
462
- setTimeout(function(){$("#no-next").removeClass("active");}, 1500);
463
- }
464
- });
465
- });
466
- </script>
467
- <script src="https://at.alicdn.com/t/c/font_3046306_9tox63bysiw.js"></script>
468
- {% include analytics.html %}
469
- {% include umami.html %}
470
- {% include busuanzi.html %}
471
- {% include pwa.html %}
472
- {% include mathjax.html %}
473
- {% include mermaid.html %}
474
- {% include webpusher.html %}
475
- </body>
476
-
477
- </html>
187
+ {% include plugins/comments/comments_block.html %}
188
+ </section>