jekyll-theme-h2o-ac 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/_config.yml +15 -17
- data/_data/collections.yml +11 -0
- data/_data/locales/en.yml +6 -0
- data/_data/locales/ja.yml +6 -0
- data/_data/locales/zh-Hans.yml +6 -0
- data/_data/locales/zh-Hant.yml +6 -0
- data/_includes/{footer.html → layouts/footer.html} +61 -35
- data/_includes/{post-head.html → layouts/head.html} +35 -29
- data/_includes/{header.html → layouts/header.html} +19 -1
- data/_includes/layouts/metainfo.html +40 -0
- data/_includes/{paginate-article.html → layouts/paginate-article.html} +9 -2
- data/_includes/{paginate.html → layouts/paginate.html} +5 -5
- data/_includes/{sidebar.html → layouts/sidebar.html} +21 -4
- data/_includes/layouts/submenu.html +30 -0
- data/_includes/plugins/analytics/analytics.html +3 -0
- data/_includes/{analytics.html → plugins/analytics/google.html} +1 -2
- data/_includes/plugins/comments/comments_block.html +67 -0
- data/_includes/plugins/comments/comments_js.html +24 -0
- data/_includes/plugins/comments/disqus.html +19 -0
- data/_includes/plugins/comments/waline_css.html +3 -0
- data/_includes/plugins/comments/waline_js.html +14 -0
- data/_includes/plugins/i18n.html +32 -0
- data/_includes/plugins/markdown/fancybox_css.html +1 -0
- data/_includes/plugins/markdown/fancybox_js.html +24 -0
- data/_includes/plugins/markdown/hotkeys.html +31 -0
- data/_includes/plugins/markdown/markdown.html +7 -0
- data/_includes/{mathjax.html → plugins/markdown/mathjax.html} +4 -9
- data/_includes/plugins/markdown/mermaid_block.html +10 -0
- data/_includes/plugins/markdown/mermaid_js.html +12 -0
- data/_includes/plugins/markdown/prism_css.html +16 -0
- data/_includes/plugins/markdown/prism_js.html +3 -0
- data/_includes/plugins/others/calendar_block.html +31 -0
- data/_includes/plugins/others/calendar_css.html +3 -0
- data/_includes/plugins/others/calendar_js.html +8 -0
- data/_includes/plugins/others/social_block.html +5 -0
- data/_includes/plugins/others/social_css.html +1 -0
- data/_includes/plugins/others/social_js.html +15 -0
- data/_layouts/404.html +17 -0
- data/_layouts/archives.html +89 -59
- data/_layouts/blog.html +4 -10
- data/_layouts/categories.html +3 -1
- data/_layouts/default.html +62 -45
- data/_layouts/links.html +14 -4
- data/_layouts/page.html +17 -87
- data/_layouts/post.html +146 -483
- data/_layouts/stats.html +52 -0
- data/_layouts/tags.html +2 -2
- data/assets/css/app.min.css +1 -2591
- data/assets/css/app.min.css.map +1 -1
- data/assets/css/cv.min.css +1 -279
- data/assets/css/cv.min.css.map +1 -1
- data/assets/js/app.min.js +1 -686
- data/assets/js/app.min.js.LICENSE.txt +15 -0
- data/assets/js/app.min.js.map +1 -1
- metadata +43 -20
- data/_includes/comments.html +0 -53
- data/_includes/head.html +0 -47
- data/_includes/mermaid.html +0 -12
- data/_includes/waline.html +0 -3
- /data/_includes/{pageNav.html → layouts/pageNav.html} +0 -0
- /data/_includes/{toc.html → layouts/toc.html} +0 -0
- /data/_includes/{busuanzi.html → plugins/analytics/busuanzi.html} +0 -0
- /data/_includes/{umami.html → plugins/analytics/umami.html} +0 -0
- /data/_includes/{pwa.html → plugins/others/pwa.html} +0 -0
- /data/_includes/{webpusher.html → plugins/others/webpusher.html} +0 -0
data/_layouts/post.html
CHANGED
@@ -1,277 +1,181 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
40
|
-
{% for tag in page.tags
|
41
|
-
|
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
|
-
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
{
|
79
|
-
|
80
|
-
|
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
|
-
|
84
|
-
|
85
|
-
{
|
86
|
-
|
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
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
{{
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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 %}
|
113
92
|
<div class="contents">
|
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
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
{{ copyright.statement.middle }}
|
151
|
-
</p>
|
152
|
-
{% if site.cclicense %}
|
153
|
-
<p>
|
154
|
-
{{ copyright.statement.right1 }}
|
155
|
-
<a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" class="extlinks">CC BY-NC-SA 4.0</a>
|
156
|
-
{{ copyright.statement.right2 }}
|
157
|
-
</p>
|
158
|
-
{% endif %}
|
159
|
-
<p><span>{{ copyright.title }}:</span>《 {{ page.title }} 》</p>
|
160
|
-
<p><span>{{ copyright.link }}:</span><a href="{{ page.url | prepend: site.url }}" class="cplink">{{ page.url | prepend: site.url }}</a></p>
|
161
|
-
<p class="tips">{{ copyright.statement.outdate1 }} <span></span> {{ copyright.statement.outdate2 }}</p>
|
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>
|
126
|
+
{% else %}
|
127
|
+
<div class="table-of-contents hidden">
|
128
|
+
{% endif %}
|
162
129
|
</div>
|
163
|
-
</article>
|
164
|
-
</div>
|
165
|
-
<div class="table-of-contents">
|
166
|
-
<h2>{{ post.outline }}</h2>
|
167
|
-
{% include toc.html html=content %}
|
168
130
|
</div>
|
169
|
-
|
170
|
-
|
171
|
-
<article class="markdown-body">
|
172
|
-
{% if page.langs %}
|
173
|
-
<p><b>{{ locales.langs }}</b>
|
174
|
-
{% assign langs = "zh-Hans, zh-Hant, en, ja" | split: ", " %}
|
175
|
-
{% assign langnames = "简中, 繁中, EN, 日本語" | split: ", " %}
|
176
|
-
{% if lang == site.default_lang %}
|
177
|
-
{% assign url = page.url %}
|
178
|
-
{% else %}
|
179
|
-
{% assign urls = page.url | split: '/' %}
|
180
|
-
{% assign url = "" %}
|
181
|
-
{% for u in urls offset:2 %}
|
182
|
-
{% assign url = url | append: "/" | append: u %}
|
183
|
-
{% endfor %}
|
184
|
-
{% endif %}
|
185
|
-
{% for l in page.langs %}
|
186
|
-
{% for i in (0..4) %}
|
187
|
-
{% if langs[i] == l %}
|
188
|
-
{% if l == page.lang %}
|
189
|
-
{{ langnames[i] }}
|
190
|
-
{% elsif l == site.default_lang %}
|
191
|
-
<a href="{{ url }}">{{ langnames[i] }}</a>
|
192
|
-
{% else %}
|
193
|
-
{% assign prefix = "/" | append: l %}
|
194
|
-
<a href="{{ url | prepend: prefix }}">{{ langnames[i] }}</a>
|
195
|
-
{% endif %}
|
196
|
-
{% endif %}
|
197
|
-
{% endfor %}
|
198
|
-
{% endfor %}
|
199
|
-
</p>
|
200
|
-
{% endif %}
|
201
|
-
{{ page.content }}
|
202
|
-
<div class="post-copyright">
|
203
|
-
{% assign copyright = post.copyright %}
|
204
|
-
<p>
|
205
|
-
<span>{{ copyright.statement.name }}:</span>
|
206
|
-
{{ copyright.statement.left }}
|
207
|
-
<a href="{{ site.url }}" class="cplink">{{ site.title }}</a>
|
208
|
-
{{ copyright.statement.middle }}
|
209
|
-
</p>
|
210
|
-
{% if site.cclicense %}
|
211
|
-
<p>
|
212
|
-
{{ copyright.statement.right1 }}
|
213
|
-
<a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" class="extlinks">CC BY-NC-SA 4.0</a>
|
214
|
-
{{ copyright.statement.right2 }}
|
215
|
-
</p>
|
216
|
-
{% endif %}
|
217
|
-
<p><span>{{ copyright.title }}:</span>《 {{ page.title }} 》</p>
|
218
|
-
<p><span>{{ copyright.link }}:</span><a href="{{ page.url | prepend: site.url }}" class="cplink">{{ page.url | prepend: site.url }}</a></p>
|
219
|
-
<p class="tips">{{ copyright.statement.outdate1 }} <span></span> {{ copyright.statement.outdate2 }}</p>
|
220
|
-
</div>
|
221
|
-
</article>
|
222
|
-
{% endif %}
|
131
|
+
{% include plugins/others/social_block.html %}
|
132
|
+
</main>
|
223
133
|
|
224
|
-
|
225
|
-
|
226
|
-
<div class="social-share"></div>
|
227
|
-
</div>
|
228
|
-
{% endif %}
|
229
|
-
</div>
|
230
|
-
|
231
|
-
<section class="author-detail">
|
232
|
-
<section class="post-footer-item author-card">
|
134
|
+
<section class="author-detail">
|
135
|
+
<section class="post-footer-item author-card">
|
233
136
|
<div class="avatar">
|
234
|
-
|
137
|
+
<img src="{{ site.avatar | relative_url }}" alt="">
|
235
138
|
</div>
|
236
139
|
<div class="author-name" rel="author">{{ site.author }}</div>
|
237
140
|
<div class="bio">
|
238
|
-
|
141
|
+
<p>{{ site.bio }}</p>
|
239
142
|
</div>
|
240
143
|
{% if site.sns.size > 0 %}
|
241
144
|
<ul class="sns-links">
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
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 %}
|
251
154
|
</ul>
|
252
155
|
{% endif %}
|
253
|
-
|
254
|
-
|
156
|
+
</section>
|
157
|
+
<section class="post-footer-item read-next">
|
255
158
|
{% if page.next.url %}
|
256
159
|
<div class="read-next-item">
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
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>
|
267
170
|
{% endif %}
|
268
171
|
|
269
172
|
{% if page.previous.url %}
|
270
173
|
<div class="read-next-item">
|
271
|
-
|
174
|
+
<a href="{{ page.previous.url | relative_url }}" class="read-next-link"
|
175
|
+
aria-label="{{ page.previous.title }}"></a>
|
272
176
|
<section>
|
273
|
-
|
274
|
-
|
177
|
+
<span>{{ page.previous.title }}</span>
|
178
|
+
<p>{{ page.previous.excerpt | strip_html | strip_newlines | truncate: 60}}</p>
|
275
179
|
</section>
|
276
180
|
{% if page.previous.cover %}
|
277
181
|
<div class="filter"></div>
|
@@ -279,247 +183,6 @@
|
|
279
183
|
{% endif %}
|
280
184
|
</div>
|
281
185
|
{% endif %}
|
282
|
-
</section>
|
283
|
-
{% if site.comments.disqus or site.comments.waline %}
|
284
|
-
<section class="post-footer-item comment">
|
285
|
-
<div class="comments-headline">
|
286
|
-
<svg class="icon" aria-hidden="true">
|
287
|
-
<use xlink:href="#icon-comment"></use>
|
288
|
-
</svg>
|
289
|
-
<span>{{ locales.post.comment }}</span>
|
290
|
-
</div>
|
291
|
-
{% if site.comments.disqus and site.comments.waline %}
|
292
|
-
<div id="comments-switch">
|
293
|
-
<span class="first-comment">Disqus</span>
|
294
|
-
<span class="switch-button">
|
295
|
-
<input id="cmn-toggle-4" class="cmn-toggle cmn-toggle-round-flat" type="checkbox">
|
296
|
-
<label for="cmn-toggle-4"></label>
|
297
|
-
</span>
|
298
|
-
<span class="second-comment">Waline</span>
|
299
|
-
</div>
|
300
|
-
{% endif %}
|
301
|
-
</section>
|
302
|
-
{% endif %}
|
303
|
-
|
304
|
-
{% if site.comments.disqus %}
|
305
|
-
<section class="post-footer-item comment">
|
306
|
-
<div id="disqus_thread"></div>
|
307
|
-
</section>
|
308
|
-
{% endif %}
|
309
|
-
|
310
|
-
{% if site.comments.waline %}
|
311
|
-
<section class="post-footer-item comment">
|
312
|
-
<div id="waline"></div>
|
313
|
-
</section>
|
314
|
-
{% endif %}
|
315
186
|
</section>
|
316
|
-
|
317
|
-
|
318
|
-
{% if page.mermaid or site.mermaid %}
|
319
|
-
<div class="modal">
|
320
|
-
<div class="modal-content">
|
321
|
-
<header>
|
322
|
-
<span class="close">×</span>
|
323
|
-
</header>
|
324
|
-
<div class="container"></div>
|
325
|
-
</div>
|
326
|
-
</div>
|
327
|
-
{% endif%}
|
328
|
-
</div>
|
329
|
-
|
330
|
-
<script src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
|
331
|
-
<script>
|
332
|
-
socialShare('.social-share', {
|
333
|
-
sites: [
|
334
|
-
{% for i in site.social-share-items %}
|
335
|
-
'{{ i }}'
|
336
|
-
{% if forloop.last == false %},
|
337
|
-
{% endif %}
|
338
|
-
{% endfor %}
|
339
|
-
],
|
340
|
-
wechatQrcodeTitle: "分享到微信朋友圈",
|
341
|
-
wechatQrcodeHelper: '<p>扫码后点击右上角</p><p>将本文分享至朋友圈</p>'
|
342
|
-
});
|
343
|
-
$("a.social-share-icon").each(function() {
|
344
|
-
$(this).attr("aria-label", $(this).attr("class").split(' ')[1])
|
345
|
-
});
|
346
|
-
</script>
|
347
|
-
|
348
|
-
{% if site.comments.disqus %}
|
349
|
-
<script>
|
350
|
-
/**
|
351
|
-
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
|
352
|
-
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
|
353
|
-
/*
|
354
|
-
var disqus_config = function () {
|
355
|
-
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
|
356
|
-
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
|
357
|
-
};
|
358
|
-
*/
|
359
|
-
(function() { // DON'T EDIT BELOW THIS LINE
|
360
|
-
var d = document, s = d.createElement('script');
|
361
|
-
s.src = '{{ site.comments.disqus_url }}';
|
362
|
-
s.setAttribute('data-timestamp', +new Date());
|
363
|
-
(d.head || d.body).appendChild(s);
|
364
|
-
})();
|
365
|
-
|
366
|
-
</script>
|
367
|
-
{% endif %}
|
368
|
-
|
369
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
|
370
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
371
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
|
372
|
-
<script src="{{ "/assets/js/app.min.js" | relative_url }}"></script>
|
373
|
-
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.min.js"></script>
|
374
|
-
<script src="https://cdn.jsdelivr.net/npm/clipboard/dist/clipboard.min.js"></script>
|
375
|
-
<script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script>
|
376
|
-
{% include waline.html %}
|
377
|
-
<script src="https://cdn.jsdelivr.net/npm/lazysizes@5.3.2/lazysizes.min.js" async></script>
|
378
|
-
<script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/dayjs.min.js"></script>
|
379
|
-
<script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/customParseFormat.js"></script>
|
380
|
-
<script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.2/plugin/relativeTime.js"></script>
|
381
|
-
<script>
|
382
|
-
/**
|
383
|
-
* Better Scroll Experience
|
384
|
-
*/
|
385
|
-
function scrollToAdjust(id){
|
386
|
-
var element = document.getElementById(id);
|
387
|
-
var headerOffset = 90;
|
388
|
-
var elementPosition = element.getBoundingClientRect().top;
|
389
|
-
var offsetPosition = elementPosition + window.scrollY - headerOffset;
|
390
|
-
window.scrollTo({
|
391
|
-
top: offsetPosition,
|
392
|
-
behavior: "smooth"
|
393
|
-
});
|
394
|
-
}
|
395
|
-
// 给图片添加链接
|
396
|
-
$(document).ready(function() {
|
397
|
-
var baseurl = $("meta[property='og:baseurl']").attr('content');
|
398
|
-
$("p img").each(function() {
|
399
|
-
$(this).attr('data-src', $(this).attr('src')).removeAttr('src').addClass("lazyload").attr('src', baseurl + '/assets/img/loading.gif');
|
400
|
-
var strA = "<a data-fancybox='gallery' ref='gallery' href='" + $(this).attr('data-src') + "' data-caption='" + $(this).attr('alt') + "'></a>";
|
401
|
-
$(this).wrapAll(strA);
|
402
|
-
var caption = $(this)[0].alt;
|
403
|
-
$(this).parent().after('<span class="caption">' + caption + '</span>');
|
404
|
-
});
|
405
|
-
|
406
|
-
Fancybox.bind('[data-fancybox]', {
|
407
|
-
on: {
|
408
|
-
load: (fancybox, slide) => {
|
409
|
-
var gray = $("meta[property='og:gray']").attr('content');
|
410
|
-
if(gray == "true"){
|
411
|
-
$(".fancybox__content img").addClass("gray");
|
412
|
-
$(".carousel__track .fancybox__thumb").addClass("gray");
|
413
|
-
}
|
414
|
-
}
|
415
|
-
}
|
416
|
-
});
|
417
|
-
|
418
|
-
{% if site.comments.waline %}
|
419
|
-
Waline.init({
|
420
|
-
el: '#waline',
|
421
|
-
serverURL: '{{ site.comments.waline_url }}',
|
422
|
-
reaction: {{ site.comments.waline_reaction }},
|
423
|
-
comment: true,
|
424
|
-
locale: {{ site.comments.waline_locale }}
|
425
|
-
});
|
426
|
-
{% endif %}
|
427
|
-
|
428
|
-
if($("#comments-switch").length > 0){
|
429
|
-
var comment_status = $("#cmn-toggle-4")[0].checked;
|
430
|
-
if(comment_status){
|
431
|
-
$("#waline").addClass("active");
|
432
|
-
}else {
|
433
|
-
$("#disqus_thread").addClass("active");
|
434
|
-
}
|
435
|
-
$("#cmn-toggle-4").click(function(){
|
436
|
-
$("#disqus_thread").toggleClass("active");
|
437
|
-
$("#waline").toggleClass("active");
|
438
|
-
})
|
439
|
-
}else {
|
440
|
-
if($("#disqus_thread").length > 0) {
|
441
|
-
$("#disqus_thread").addClass("active");
|
442
|
-
}else if($("#waline").length > 0) {
|
443
|
-
$("#waline").addClass("active");
|
444
|
-
}
|
445
|
-
}
|
446
|
-
|
447
|
-
var time_formats = ['YYYY-MM-DD HH:mm:ss ZZ', 'YYYY DD MMM HH:mm:ss ZZ', 'YYYY年MM月DD日 HH:mm:ss ZZ'];
|
448
|
-
function dateFormat(date, format){
|
449
|
-
var date_org = dayjs(date, time_formats[format]);
|
450
|
-
var date = date_org.format(time_formats[format]);
|
451
|
-
return {"date_org": date_org, "date": date}
|
452
|
-
}
|
453
|
-
|
454
|
-
dayjs.extend(window.dayjs_plugin_customParseFormat);
|
455
|
-
dayjs.extend(window.dayjs_plugin_relativeTime);
|
456
|
-
var post_date = $("meta[property='post-date']").attr('content');
|
457
|
-
var post_date_format = $("meta[property='post-date-format']").attr('content');
|
458
|
-
var local_post_date = dateFormat(post_date, post_date_format);
|
459
|
-
|
460
|
-
$(".post time span.create-at").html(local_post_date["date"]);
|
461
|
-
|
462
|
-
fetch("https://api.github.com/repos/{{ site.github.owner }}/{{ site.github.repository }}/commits?path={{ page.path }}")
|
463
|
-
.then((response) => {
|
464
|
-
return response.json();
|
465
|
-
})
|
466
|
-
.then((commits) => {
|
467
|
-
if(commits.length != 0){
|
468
|
-
var update_at = dayjs(commits[0]['commit']['committer']['date']);
|
469
|
-
}else {
|
470
|
-
var update_at = post_date
|
471
|
-
}
|
472
|
-
|
473
|
-
var local_update_at = dateFormat(update_at, post_date_format);
|
474
|
-
$('.post time span.update-at').html(local_update_at["date"]);
|
475
|
-
|
476
|
-
var relative_time = dayjs().diff(local_update_at["date_org"], 'day');
|
477
|
-
$(".post-copyright .tips span").append(relative_time);
|
478
|
-
if(relative_time > 365){
|
479
|
-
$(".post-copyright .tips").addClass("active");
|
480
|
-
}
|
481
|
-
});
|
482
|
-
|
483
|
-
/*
|
484
|
-
* Keyboard shortcut bind: left and right
|
485
|
-
*/
|
486
|
-
|
487
|
-
var previous_url = $("meta[property='og:previous_url']").attr('content');
|
488
|
-
var next_url = $("meta[property='og:next_url']").attr('content');
|
489
|
-
|
490
|
-
hotkeys('left', function(event, handler){
|
491
|
-
// Prevent the default refresh event under WINDOWS system
|
492
|
-
event.preventDefault();
|
493
|
-
if(previous_url){
|
494
|
-
console.log('you pressed left!');
|
495
|
-
window.location.href = previous_url;
|
496
|
-
}else {
|
497
|
-
$("#no-previous").addClass("active");
|
498
|
-
setTimeout(function(){$("#no-previous").removeClass("active");}, 1500);
|
499
|
-
}
|
500
|
-
});
|
501
|
-
|
502
|
-
hotkeys('right', function(event, handler){
|
503
|
-
// Prevent the default refresh event under WINDOWS system
|
504
|
-
event.preventDefault();
|
505
|
-
if(next_url){
|
506
|
-
console.log('you pressed right!');
|
507
|
-
window.location.href = next_url;
|
508
|
-
}else {
|
509
|
-
$("#no-next").addClass("active");
|
510
|
-
setTimeout(function(){$("#no-next").removeClass("active");}, 1500);
|
511
|
-
}
|
512
|
-
});
|
513
|
-
});
|
514
|
-
</script>
|
515
|
-
<script src="https://at.alicdn.com/t/font_3046306_skfh9jzzbbf.js"></script>
|
516
|
-
{% include analytics.html %}
|
517
|
-
{% include umami.html %}
|
518
|
-
{% include busuanzi.html %}
|
519
|
-
{% include pwa.html %}
|
520
|
-
{% include mathjax.html %}
|
521
|
-
{% include mermaid.html %}
|
522
|
-
{% include webpusher.html %}
|
523
|
-
</body>
|
524
|
-
|
525
|
-
</html>
|
187
|
+
{% include plugins/comments/comments_block.html %}
|
188
|
+
</section>
|