hexo-theme-stellar 1.6.1 → 1.9.0

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.
Files changed (61) hide show
  1. package/_config.yml +145 -34
  2. package/languages/zh-CN.yml +2 -2
  3. package/languages/zh-TW.yml +2 -2
  4. package/layout/404.ejs +1 -1
  5. package/layout/_partial/cover/index.ejs +12 -0
  6. package/layout/_partial/cover/post_cover.ejs +41 -0
  7. package/layout/_partial/{main/article → cover}/wiki_cover.ejs +1 -4
  8. package/layout/_partial/head.ejs +14 -2
  9. package/layout/_partial/main/article/article_footer.ejs +4 -4
  10. package/layout/_partial/main/post_list/paginator.ejs +2 -2
  11. package/layout/_partial/main/post_list/post_card.ejs +43 -5
  12. package/layout/_partial/main/post_list/wiki_card.ejs +2 -0
  13. package/layout/_partial/plugins/comments/giscus/layout.ejs +39 -0
  14. package/layout/_partial/plugins/comments/giscus/script.ejs +26 -0
  15. package/layout/_partial/plugins/comments/layout.ejs +1 -1
  16. package/layout/_partial/plugins/comments/valine/script.ejs +1 -1
  17. package/layout/_partial/plugins/comments/waline/layout.ejs +19 -0
  18. package/layout/_partial/plugins/comments/waline/script.ejs +22 -0
  19. package/layout/_partial/scripts/index.ejs +7 -1
  20. package/layout/_partial/sidebar/widgets/recent.ejs +5 -13
  21. package/layout/index.ejs +5 -2
  22. package/layout/layout.ejs +1 -1
  23. package/layout/mathjax.ejs +29 -0
  24. package/layout/page.ejs +1 -1
  25. package/layout/post.ejs +9 -2
  26. package/package.json +1 -1
  27. package/scripts/events/index.js +5 -7
  28. package/scripts/tags/grid.js +35 -0
  29. package/scripts/tags/image.js +21 -1
  30. package/scripts/tags/index.js +3 -0
  31. package/scripts/tags/lib/users.js +23 -0
  32. package/scripts/tags/note.js +7 -22
  33. package/scripts/tags/poetry.js +48 -0
  34. package/scripts/tags/quot.js +51 -0
  35. package/scripts/tags/{site.js → sites.js} +3 -0
  36. package/source/css/_common/base.styl +9 -0
  37. package/source/css/_common/cap.styl +1 -0
  38. package/source/css/_common/highlight.styl +15 -4
  39. package/source/css/_custom.styl +6 -5
  40. package/source/css/_layout/list.styl +65 -35
  41. package/source/css/_layout/main.styl +2 -2
  42. package/source/css/_layout/md.styl +38 -21
  43. package/source/css/_layout/pages/archives.styl +1 -0
  44. package/source/css/_layout/partial/article-footer.styl +0 -2
  45. package/source/css/_layout/partial/cover.styl +50 -10
  46. package/source/css/_layout/partial/footer.styl +6 -0
  47. package/source/css/_layout/partial/related.styl +1 -0
  48. package/source/css/_layout/sidebar/sidebar.styl +21 -6
  49. package/source/css/_layout/tag-plugins/folding.styl +3 -0
  50. package/source/css/_layout/tag-plugins/frame.styl +1 -1
  51. package/source/css/_layout/tag-plugins/image.styl +1 -2
  52. package/source/css/_layout/tag-plugins/inline-labels.styl +3 -0
  53. package/source/css/_layout/tag-plugins/poetry.styl +50 -0
  54. package/source/css/_layout/tag-plugins/quot.styl +82 -0
  55. package/source/css/_plugins/comments/utterances.styl +3 -0
  56. package/source/css/_plugins/comments/waline.styl +61 -0
  57. package/source/css/_plugins/fancybox.styl +5 -0
  58. package/source/css/_plugins/index.styl +4 -0
  59. package/source/js/main.js +60 -13
  60. package/source/js/plugins/friends.js +6 -5
  61. package/source/js/plugins/sites.js +2 -2
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.6.1'
3
+ version: '1.9.0'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -65,8 +65,10 @@ breadcrumb:
65
65
 
66
66
  ######## Article ########
67
67
  article:
68
- # 如果没有指定封面,是否根据 tags 作为关键词搜索封面?
68
+ # 如果没有指定封面,是否根据 tags 作为关键词搜索封面图片?
69
69
  auto_cover: false # search from https://source.unsplash.com/
70
+ # 如果没有指定横幅,是否根据 tags 作为关键词搜索横幅图片?
71
+ auto_banner: false # search from https://source.unsplash.com/
70
72
  # 如果没有指定 excerpt 和 description,将自动取多长的内容作为文章摘要?
71
73
  auto_excerpt: 200
72
74
  # 分类颜色
@@ -84,10 +86,9 @@ article:
84
86
  auto_cover: true # 如果没有封面就根据 tags 作为关键词搜索封面,开了此项将不会自动从文章中提取首张图片作为封面了。
85
87
 
86
88
 
87
-
88
89
  ######## Comments ########
89
90
  comments:
90
- service: # beaudar, utterances, valine, twikoo
91
+ service: # beaudar, utterances, valine, twikoo, waline
91
92
  # beaudar
92
93
  # https://beaudar.lipk.org/
93
94
  beaudar:
@@ -109,8 +110,25 @@ comments:
109
110
  issue-number:
110
111
  theme: preferred-color-scheme
111
112
  label:
113
+ # giscus
114
+ # https://giscus.app/zh-CN
115
+ giscus:
116
+ data-repo: xxx/xxx # [在此输入仓库]
117
+ data-repo-id: # [在此输入仓库 ID]
118
+ data-category: # [在此输入分类名]
119
+ data-category-id:
120
+ data-mapping: pathname
121
+ data-strict: 0
122
+ data-reactions-enabled: 1
123
+ data-emit-metadata: 0
124
+ data-input-position: top # top, bottom
125
+ data-theme: preferred_color_scheme
126
+ data-lang: zh-CN
127
+ data-loading: lazy
128
+ crossorigin: anonymous
129
+
112
130
  valine:
113
- js: https://cdn.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js
131
+ js: https://fastly.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js
114
132
  appId: # your appId
115
133
  appKey: # your appKey
116
134
  placeholder:
@@ -134,23 +152,69 @@ comments:
134
152
  # Twikoo
135
153
  # https://twikoo.js.org/
136
154
  twikoo:
137
- js: https://cdn.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本
155
+ js: https://fastly.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本
138
156
  envId: https://xxx # vercel函数
157
+ waline:
158
+ js: https://unpkg.com/@waline/client@v2/dist/waline.js
159
+ css: https://unpkg.com/@waline/client@v2/dist/waline.css
160
+ # Waline server address url, you should set this to your own link
161
+ serverURL:
162
+
163
+ # If false, comment count will only be displayed in post page, not in home page
164
+ commentCount: true
165
+
166
+ # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`.
167
+ pageview: false
168
+
169
+ # Custom locales
170
+ # locale:
171
+ # placeholder: Welcome to comment # Comment box placeholder
172
+
173
+ # Custom emoji
174
+ # emoji:
175
+ # - https://unpkg.com/@waline/emojis@1.0.1/weibo
176
+ # - https://unpkg.com/@waline/emojis@1.0.1/alus
177
+ # - https://unpkg.com/@waline/emojis@1.0.1/bilibili
178
+ # - https://unpkg.com/@waline/emojis@1.0.1/qq
179
+ # - https://unpkg.com/@waline/emojis@1.0.1/tieba
180
+ # - https://unpkg.com/@waline/emojis@1.0.1/tw-emoji
181
+
182
+ # Comment infomation, valid meta are nick, mail and link
183
+ # meta:
184
+ # - nick
185
+ # - mail
186
+ # - link
187
+
188
+ # Set required meta field, e.g.: [nick] | [nick, mail]
189
+ # requiredMeta:
190
+ # - nick
191
+
192
+ # Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP
193
+ # lang: zh-CN
194
+
195
+ # Word limit, no limit when setting to 0
196
+ # wordLimit: 0
197
+
198
+ # Whether enable login, can choose from 'enable', 'disable' and 'force'
199
+ # login: enable
200
+
201
+ # comment per page
202
+ # pageSize: 10
139
203
 
140
204
  ######## Footer ########
141
205
  footer:
142
206
  social:
143
207
  # github:
144
- # icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/08a41b181ce68.svg"/>'
208
+ # icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/08a41b181ce68.svg"/>'
145
209
  # url: /
146
210
  # music:
147
- # icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3845874.svg"/>'
211
+ # icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3845874.svg"/>'
148
212
  # url: /
149
213
  # unsplash:
150
- # icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3616429.svg"/>'
214
+ # icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/3616429.svg"/>'
151
215
  # url: /
152
216
  # comments:
153
- # icon: '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/942ebbf1a4b91.svg"/>'
217
+ # icon: '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.3/social/942ebbf1a4b91.svg"/>'
154
218
  # url: /about/#comments
155
219
  sitemap:
156
220
  # '博客':
@@ -166,7 +230,7 @@ footer:
166
230
  # '更多':
167
231
  # - '[关于本站](/)'
168
232
  # - '[GitHub](/)'
169
- license: '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
233
+ license: # '[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)'
170
234
  source: #'[GitHub](https://github.com/xaoxuu/hexo-theme-stellar)'
171
235
  more: # string or array (support markdown)
172
236
 
@@ -179,28 +243,31 @@ tag_plugins:
179
243
  # {% checkbox %}
180
244
  checkbox:
181
245
  interactive: false # enable interactive for user
246
+ # {% quot %}
247
+ quot:
248
+ default: # 可以自行配置多种图标方案
249
+ prefix: https://s2.loli.net/2022/01/04/vsTB5pGrIHfPxSj.png
250
+ suffix: https://s2.loli.net/2022/01/04/NORdtjlAhifZSns.png
251
+ hashtag:
252
+ prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png
253
+ # {% emoji %}
182
254
  emoji:
183
- default: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
184
- twemoji: https://cdn.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg
185
- qq: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
186
- aru: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif
187
- tieba: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png
255
+ default: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
256
+ twemoji: https://fastly.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg
257
+ qq: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif
258
+ aru: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif
259
+ tieba: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png
260
+ # {% image %}
261
+ image:
262
+ fancybox: # true, false
188
263
 
189
264
 
190
265
  ######## JS Plugins ########
191
266
  plugins:
192
267
  ## required plugins ##
193
268
  # jquery
194
- jquery: https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
269
+ jquery: https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
195
270
 
196
- ## lazyload plugins ##
197
- # fancybox
198
- fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
199
- # swiper
200
- swiper:
201
- enable: true
202
- css: https://unpkg.com/swiper@6/swiper-bundle.min.css
203
- js: https://unpkg.com/swiper@6/swiper-bundle.min.js
204
271
  # issues api
205
272
  sitesjs: /js/plugins/sites.js
206
273
  friendsjs: /js/plugins/friends.js
@@ -210,25 +277,68 @@ plugins:
210
277
  preload:
211
278
  enable: true
212
279
  service: flying_pages # instant_page, flying_pages
213
- instant_page: https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js
214
- flying_pages: https://cdn.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js
280
+ instant_page: https://fastly.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js
281
+ flying_pages: https://fastly.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js
215
282
 
216
283
  # image lazyload
217
284
  # https://www.npmjs.com/package/vanilla-lazyload
218
285
  lazyload:
219
286
  enable: true # [hexo clean && hexo s] is required after changing this value.
220
- js: https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js
287
+ js: https://fastly.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js
221
288
  transition: blur # blur, fade
222
289
 
223
290
  # https://scrollrevealjs.org/api/reveal.html
224
291
  scrollreveal:
225
292
  enable: #true
226
- js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js
293
+ js: https://fastly.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js
227
294
  distance: 8px
228
295
  duration: 500 # ms
229
296
  interval: 100 # ms
230
297
  scale: 1 # 0.1~1
231
298
 
299
+ # https://fancyapps.com/docs/ui/fancybox/
300
+ # available for {% image xxx %}
301
+ fancybox:
302
+ enable: true
303
+ js: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js
304
+ css: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css
305
+ # 可以处理评论区的图片(不支持 iframe 类评论系统)例如:
306
+ # 使用valine评论可以写: .vcontent img:not(.vemoji)
307
+ # 使用twikoo评论可以写: .tk-content img:not([class*="emo"])
308
+ # 使用waline评论可以写: #waline_container .vcontent img
309
+ selector: .swiper-slide img # 多个选择器用英文逗号隔开
310
+
311
+ # swiper
312
+ swiper:
313
+ enable: true
314
+ css: https://unpkg.com/swiper@6/swiper-bundle.min.css
315
+ js: https://unpkg.com/swiper@6/swiper-bundle.min.js
316
+
317
+
318
+ # 赫蹏 (Heti) - 专为中文网页内容设计的排版样式增强
319
+ # https://github.com/sivan/heti
320
+ heti:
321
+ enable: false
322
+ css: https://unpkg.com/heti/umd/heti.min.css
323
+ js: https://unpkg.com/heti/umd/heti-addon.min.js
324
+
325
+ # MathJax
326
+ # 需在Markdown文件开头加入mathjax: true
327
+ # 推荐使用Pandoc: npm uninstall hexo-renderer-marked --save & npm install hexo-renderer-pandoc --save
328
+ mathjax:
329
+ enable: false
330
+ cdn: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML
331
+
332
+ # Katex - The fastest math typesetting library for the web
333
+ # https://katex.org/docs/autorender.html
334
+ # https://github.com/KaTeX/KaTeX
335
+ # 使用 hexo-renderer-markdown-it-plus 作为公式渲染器:npm uninstall hexo-renderer-marked --save npm install hexo-renderer-markdown-it-plus --save
336
+ katex:
337
+ enable: false
338
+ min_css: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css" integrity="sha384-Xi8rHCmBmhbuyyhbI88391ZKP2dmfnOl4rT9ZfRI7mLTdk1wblIUnrIq35nqwEvC" crossorigin="anonymous">
339
+ min_js: <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js" integrity="sha384-X/XCfMm41VSsqRNQgDerQczD69XqmjOOOwYQvr/uuC+j4OPoNhVgjdGFwhvN02Ja" crossorigin="anonymous"></script>
340
+ auto_render_min_js: <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"onload="renderMathInElement(document.body);"></script>
341
+
232
342
  style:
233
343
  darkmode: auto # auto / always / false
234
344
  theme:
@@ -236,12 +346,13 @@ style:
236
346
  dark: '#313438'
237
347
  animated_avatar:
238
348
  animate: auto # auto, always
239
- background: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
349
+ background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
240
350
  codeblock:
241
351
  scrollbar: 4px
352
+ highlightjs_theme: https://fastly.jsdelivr.net/gh/highlightjs/cdn-release@11.5.0/build/styles/atom-one-dark.min.css
242
353
 
243
354
  default:
244
- avatar: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
245
- link: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg
246
- cover: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
247
- image: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
355
+ avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg
356
+ link: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg
357
+ cover: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
358
+ image: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
@@ -38,8 +38,8 @@ meta:
38
38
 
39
39
  footer:
40
40
  license: '本博客所有文章除特别声明外,均采用 %s 许可协议,转载请注明出处。'
41
- info_not_open_source: '本站由 %s 创建,使用 %s 作为主题。'
42
- info_open_source: '本站由 %s 创建,使用 %s 作为主题,您可以在 %s 找到本站源码。'
41
+ info_not_open_source: '本站由 %s 使用 %s 主题创建。'
42
+ info_open_source: '本站由 %s 使用 %s 主题创建,您可以在 %s 找到本站源码。'
43
43
 
44
44
  page:
45
45
  error:
@@ -38,8 +38,8 @@ meta:
38
38
 
39
39
  footer:
40
40
  license: '本網誌所有文章除特別聲明外,均採用 %s 授權條款。轉載請註明出處。'
41
- info_not_open_source: '本站由 %s 建立,使用 %s 作為主題。'
42
- info_open_source: '本站由 %s 建立,使用 %s 作為主題。您可以在 %s 找到本站原始碼。'
41
+ info_not_open_source: '本站由 %s 使用 %s 主題建立。'
42
+ info_open_source: '本站由 %s 使用 %s 主題建立。您可以在 %s 找到本站原始碼。'
43
43
 
44
44
  page:
45
45
  error:
package/layout/404.ejs CHANGED
@@ -6,7 +6,7 @@ page.header = false;
6
6
  page.robots = 'none';
7
7
  %>
8
8
  <article class='md error-page'>
9
- <h1><img id='error' src='https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/404/1c830bfcd517d.svg' alt='404'></h1>
9
+ <h1><img id='error' src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/404/1c830bfcd517d.svg' alt='404'></h1>
10
10
  <p class='what'>
11
11
  <strong>
12
12
  <%- __('page.error.what') %>
@@ -0,0 +1,12 @@
1
+ <%
2
+ function layoutCover() {
3
+ if (page.layout == 'wiki') {
4
+ return partial('wiki_cover');
5
+ }
6
+ if (page.layout == 'post') {
7
+ return partial('post_cover');
8
+ }
9
+ return '';
10
+ }
11
+ %>
12
+ <%- layoutCover() %>
@@ -0,0 +1,41 @@
1
+ <%
2
+ function div() {
3
+ var el = '';
4
+ if ((page.banner == undefined || page.banner == false) && !theme.article.auto_banner) {
5
+ return el;
6
+ }
7
+ var url;
8
+ if (page.banner != undefined) {
9
+ if (page.banner.includes('/')) {
10
+ url = page.banner;
11
+ } else {
12
+ url = 'https://source.unsplash.com/2000x400/?' + page.banner;
13
+ }
14
+ } else {
15
+ // 自动以 tags 作为关键词搜索封面
16
+ if (page.tags) {
17
+ var params = '';
18
+ page.tags.reverse().forEach((tag, i) => {
19
+ if (i > 0) {
20
+ params += ',';
21
+ }
22
+ params += tag.name;
23
+ });
24
+ url = 'https://source.unsplash.com/2000x400/?' + params;
25
+ } else {
26
+ url = 'https://source.unsplash.com/random/2000x400';
27
+ }
28
+ }
29
+ el += '<div class="l_cover post' + scrollreveal() + '">';
30
+ el += '<div class="cover">';
31
+ if (theme.plugins.lazyload && theme.plugins.lazyload.enable) {
32
+ el += '<div class="lazy img bg" data-bg="' + url + '"></div>';
33
+ } else {
34
+ el += '<div class="lazy img bg" style="background-image:url(&quot;' + url + '&quot;)"></div>';
35
+ }
36
+ el += '</div>';
37
+ el += '</div>';
38
+ return el;
39
+ }
40
+ %>
41
+ <%- div() %>
@@ -1,9 +1,6 @@
1
1
  <%
2
2
  function layoutWikiCover() {
3
3
  var el = '';
4
- if (page.layout !== 'wiki') {
5
- return el;
6
- }
7
4
  let proj = theme.wiki.projects[page.wiki];
8
5
  if (proj == undefined) {
9
6
  return el;
@@ -21,7 +18,7 @@ function layoutWikiCover() {
21
18
  if (cover === true) {
22
19
  cover = ['logo', 'title', 'description'];
23
20
  }
24
- el += '<div class="l_cover' + scrollreveal() + '">';
21
+ el += '<div class="l_cover wiki' + scrollreveal() + '">';
25
22
  el += '<article class="cover-wrap md">';
26
23
 
27
24
  if (logo && logo.src && cover.includes('logo')) {
@@ -49,8 +49,9 @@ function og_args() {
49
49
  <%- generate_robots() %>
50
50
 
51
51
  <meta http-equiv='x-dns-prefetch-control' content='on' />
52
- <link rel='dns-prefetch' href='https://cdn.jsdelivr.net'>
53
- <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
52
+ <link rel='dns-prefetch' href='https://fastly.jsdelivr.net'>
53
+ <link rel="preconnect" href="https://fastly.jsdelivr.net" crossorigin>
54
+ <link rel='dns-prefetch' href='//unpkg.com'>
54
55
 
55
56
  <meta name="renderer" content="webkit">
56
57
  <meta name="force-rendering" content="webkit">
@@ -81,6 +82,17 @@ function og_args() {
81
82
  <%- favicon_tag(config.favicon) %>
82
83
  <% } %>
83
84
 
85
+ <% if (config.highlight && config.highlight.enable == true && config.highlight.hljs == true) { %>
86
+ <%- css(theme.style.codeblock.highlightjs_theme) %>
87
+ <% } %>
88
+
89
+ <% if (theme.plugins.katex && theme.plugins.katex.enable) { %>
90
+ <%- theme.plugins.katex.min_css %>
91
+ <%- theme.plugins.katex.min_js %>
92
+ <%- theme.plugins.katex.auto_render_min_js %>
93
+ <% } %>
94
+
95
+
84
96
  <% if (config.inject && config.inject.head){ %>
85
97
  <% (config.inject.head||[]).forEach(function(item){ %>
86
98
  <%- item %>
@@ -85,13 +85,13 @@ function layoutDiv() {
85
85
  }
86
86
  el += '>';
87
87
  if (item == 'wechat') {
88
- el += '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/b32ef3da1162a.svg"/>';
88
+ el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/b32ef3da1162a.svg"/>';
89
89
  } else if (item == 'weibo') {
90
- el += '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/80c07e4dbb303.svg"/>';
90
+ el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/80c07e4dbb303.svg"/>';
91
91
  } else if (item == 'email') {
92
- el += '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/a1b00e20f425d.svg"/>';
92
+ el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/a1b00e20f425d.svg"/>';
93
93
  } else if (item == 'link') {
94
- el += '<img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/8411ed322ced6.svg"/>';
94
+ el += '<img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/social/8411ed322ced6.svg"/>';
95
95
  }
96
96
  el += '</a>';
97
97
  }
@@ -1,13 +1,13 @@
1
1
  <% if (is_home() && page.total > 1) { %>
2
2
  <div class='paginator-wrap dis-select'>
3
3
  <a class='paginator prev<%- page.prev != 0 ? "" : " disable" %>' href='<%- url_for(page.prev_link) %>'>
4
- <img src='https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/f049bbd4e88ec.svg'/>
4
+ <img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/f049bbd4e88ec.svg'/>
5
5
  </a>
6
6
  <div class='paginator current'>
7
7
  <%- page.current %><span class='sep'></span><%- page.total %>
8
8
  </div>
9
9
  <a class='paginator next<%- page.next != 0 ? "" : " disable" %>' href='<%- url_for(page.next_link) %>'>
10
- <img src='https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/064b95430caf4.svg'/>
10
+ <img src='https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/arrow/064b95430caf4.svg'/>
11
11
  </a>
12
12
  </div>
13
13
  <% } %>
@@ -1,6 +1,8 @@
1
1
  <%
2
- function layoutDiv() {
2
+ function div_default() {
3
3
  var el = '';
4
+ el += '<article class="md">';
5
+
4
6
  // 封面
5
7
  if (post.cover || theme.article.auto_cover) {
6
8
  var cover_url;
@@ -38,7 +40,11 @@ function layoutDiv() {
38
40
  el += '</h2>';
39
41
 
40
42
  // 摘要
41
- el += '<div class="excerpt">';
43
+ el += '<div class="excerpt';
44
+ if (theme.plugins.heti && theme.plugins.heti.enable) {
45
+ el += ' heti';
46
+ }
47
+ el += '">';
42
48
  el += '<p>';
43
49
  if (post.excerpt) {
44
50
  el += strip_html(post.excerpt);
@@ -74,11 +80,43 @@ function layoutDiv() {
74
80
  }
75
81
  }
76
82
  if (post.pin) {
77
- el += '<span class="pin"><img src="https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/badge/3279dd441df8b.svg"/></span>';
83
+ el += '<span class="pin"><img src="https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/badge/3279dd441df8b.svg"/></span>';
78
84
  }
79
- el += '<div>';
85
+ el += '</div>';
86
+ el += '</article>';
87
+ return el;
88
+ }
89
+ function div_photo() {
90
+ var el = '';
91
+ el += '<div class="cover">';
92
+ el += '<img src="' + post.cover + '"/>';
93
+ if (post.cover_info) {
94
+ el += '<div class="cover-info"';
95
+ if (post.cover_info.meta) {
96
+ el += 'position="top">';
97
+ } else {
98
+ el += 'position="bottom">';
99
+ }
100
+ if (post.cover_info.meta) {
101
+ el += '<div class="cap">' + post.cover_info.meta + '</div>';
102
+ }
103
+ if (post.cover_info.title) {
104
+ el += '<div class="title">' + post.cover_info.title + '</div>';
105
+ }
106
+ if (post.cover_info.subtitle) {
107
+ el += '<div class="cap">' + post.cover_info.subtitle + '</div>';
108
+ }
109
+ el += '</div>';
80
110
 
111
+ }
112
+ el += '</div>';
81
113
  return el;
82
114
  }
115
+ function div() {
116
+ if (post.cover && post.cover.length > 0 && post.cover_info != undefined) {
117
+ return div_photo();
118
+ }
119
+ return div_default();
120
+ }
83
121
  %>
84
- <%- layoutDiv() %>
122
+ <%- div() %>
@@ -1,6 +1,7 @@
1
1
  <%
2
2
  function layoutDiv() {
3
3
  var el = '';
4
+ el += '<article class="md">';
4
5
  if (proj.logo && proj.logo.src) {
5
6
  el += '<div class="preview">';
6
7
  el += '<img src="' + proj.logo.src + '" alt="logo"';
@@ -20,6 +21,7 @@ function layoutDiv() {
20
21
  el += '<p>' + proj.description + '</p>';
21
22
  }
22
23
  el += '</div>';
24
+ el += '</article>';
23
25
  return el;
24
26
  }
25
27
  %>
@@ -0,0 +1,39 @@
1
+ <%
2
+ function layoutDiv() {
3
+ const cmt = 'giscus';
4
+ // 合并配置参数
5
+ var config = Object.assign({}, theme.comments[cmt]);
6
+ if (page.layout === 'wiki' && page.wiki) {
7
+ let proj = theme.wiki.projects[page.wiki];
8
+ if (proj[cmt] != undefined) {
9
+ Object.assign(config, proj[cmt]);
10
+ }
11
+ }
12
+ Object.assign(config, page[cmt]);
13
+ // 合并评论数据
14
+ if (page.comment_id != undefined) {
15
+ config['data-mapping'] = 'specific';
16
+ config['data-term'] = page.comment_id;
17
+ } else if (page.layout === 'wiki' && page.wiki) {
18
+ let proj = theme.wiki.projects[page.wiki];
19
+ if (proj.comment_id != undefined) {
20
+ config['data-mapping'] = 'specific';
21
+ config['data-term'] = proj.comment_id;
22
+ }
23
+ }
24
+ // 布局
25
+ var el = '';
26
+ el += '<div id="' + cmt + '"';
27
+ for (let key of Object.keys(config)) {
28
+ if (config[key] !== null) {
29
+ el += ' ' + key + '="' + config[key] + '"';
30
+ }
31
+ }
32
+ el += '></div>';
33
+ return el;
34
+ }
35
+ %>
36
+
37
+ <svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg>
38
+
39
+ <%- layoutDiv() %>
@@ -0,0 +1,26 @@
1
+ <script>
2
+ function loadJS() {
3
+ const els = document.querySelectorAll("#comments #giscus");
4
+ if (els.length === 0) return;
5
+ els.forEach((el, i) => {
6
+ try {
7
+ el.innerHTML = '';
8
+ } catch (error) {
9
+ console.log(error);
10
+ }
11
+ var script = document.createElement('script');
12
+ script.src = 'https://giscus.app/client.js';
13
+ script.async = true;
14
+ for (let key of Object.keys(el.attributes)) {
15
+ let attr = el.attributes[key];
16
+ if (['class', 'id'].includes(attr.name) === false) {
17
+ script.setAttribute(attr.name, attr.value);
18
+ }
19
+ }
20
+ el.appendChild(script);
21
+ });
22
+ }
23
+ window.addEventListener('DOMContentLoaded', (event) => {
24
+ loadJS();
25
+ });
26
+ </script>
@@ -9,7 +9,7 @@ if (theme.comments.service && theme.comments.service.length > 0) {
9
9
  if (loadComment && page.layout == 'wiki' && page.wiki) {
10
10
  let proj = theme.wiki.projects[page.wiki];
11
11
  if (proj.comment_title != undefined && page.comment_title == undefined) {
12
- if (['utterances', 'beaudar'].includes(theme.comments.service)) {
12
+ if (['utterances', 'beaudar', 'giscus'].includes(theme.comments.service)) {
13
13
  page.comment_title = proj.comment_title;
14
14
  }
15
15
  }
@@ -35,7 +35,7 @@
35
35
  el: '#valine_container',
36
36
  path: path,
37
37
  placeholder: placeholder,
38
- emojiCDN: 'https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
38
+ emojiCDN: 'https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
39
39
  emojiMaps: getEmojiMaps(),
40
40
  }));
41
41
  });
@@ -0,0 +1,19 @@
1
+ <%
2
+ function layoutDiv() {
3
+ var el = '';
4
+ el += '<div id="waline_container" class="waline_thread"';
5
+ let cfg = {};
6
+ if (page.comment_id) {
7
+ cfg['comment_id'] = page.comment_id;
8
+ }
9
+ for (let key of Object.keys(cfg)) {
10
+ if (cfg[key]) {
11
+ el += ' ' + key + '="' + cfg[key] + '"';
12
+ }
13
+ }
14
+ el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
15
+ return el;
16
+ }
17
+ %>
18
+
19
+ <%- layoutDiv() %>