hexo-theme-fluid 1.8.10 → 1.8.14

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 (56) hide show
  1. package/README.md +3 -5
  2. package/_config.yml +88 -46
  3. package/languages/eo.yml +44 -0
  4. package/layout/_partial/archive-list.ejs +2 -2
  5. package/layout/_partial/beian.ejs +3 -3
  6. package/layout/_partial/comments/changyan.ejs +3 -13
  7. package/layout/_partial/comments/cusdis.ejs +25 -0
  8. package/layout/_partial/comments/disqus.ejs +1 -1
  9. package/layout/_partial/comments/gitalk.ejs +8 -16
  10. package/layout/_partial/comments/remark42.ejs +8 -10
  11. package/layout/_partial/comments/twikoo.ejs +11 -6
  12. package/layout/_partial/comments/valine.ejs +13 -16
  13. package/layout/_partial/comments/waline.ejs +12 -18
  14. package/layout/_partial/css.ejs +2 -3
  15. package/layout/_partial/footer.ejs +1 -1
  16. package/layout/_partial/head.ejs +13 -10
  17. package/layout/_partial/nav.ejs +8 -6
  18. package/layout/_partial/plugins/math.ejs +12 -0
  19. package/layout/_partial/plugins/typed.ejs +12 -12
  20. package/layout/_partial/post-meta.ejs +4 -7
  21. package/layout/_partial/scripts.ejs +17 -15
  22. package/layout/categories.ejs +5 -13
  23. package/layout/index.ejs +6 -13
  24. package/layout/layout.ejs +4 -4
  25. package/layout/links.ejs +2 -2
  26. package/package.json +3 -17
  27. package/scripts/events/lib/compatible-configs.js +8 -0
  28. package/scripts/events/lib/highlight.js +12 -2
  29. package/scripts/events/lib/lazyload.js +3 -3
  30. package/scripts/helpers/export-config.js +3 -1
  31. package/scripts/helpers/url.js +4 -4
  32. package/scripts/helpers/utils.js +5 -0
  33. package/scripts/helpers/wordcount.js +28 -25
  34. package/scripts/utils/compare-versions.js +118 -0
  35. package/scripts/utils/{join-path.js → url-join.js} +2 -2
  36. package/source/css/_pages/_about/about.styl +1 -3
  37. package/source/css/_pages/_base/_widget/footer.styl +0 -7
  38. package/source/css/_pages/_base/_widget/qrcode.styl +2 -1
  39. package/source/css/_pages/_base/base.styl +20 -0
  40. package/source/css/_pages/_base/color-schema.styl +4 -9
  41. package/source/css/_pages/_base/rewrite.styl +24 -13
  42. package/source/css/_pages/_index/index.styl +1 -0
  43. package/source/css/_pages/_links/links.styl +1 -2
  44. package/source/css/_pages/_post/post.styl +22 -0
  45. package/source/css/_pages/_post/tag_plugin.styl +1 -0
  46. package/source/css/_variables/base.styl +7 -0
  47. package/source/js/color-schema.js +33 -12
  48. package/source/js/events.js +17 -17
  49. package/source/js/leancloud.js +24 -18
  50. package/source/js/local-search.js +143 -123
  51. package/source/js/plugins.js +15 -15
  52. package/source/js/utils.js +52 -47
  53. package/.github/workflows/lint.yaml +0 -33
  54. package/gulpfile.js +0 -49
  55. package/layout/_partial/plugins/local-search.ejs +0 -14
  56. package/source/lib/hint/hint.min.css +0 -5
package/README.md CHANGED
@@ -122,13 +122,11 @@ layout: about
122
122
 
123
123
  ## 支持
124
124
 
125
- 你可以通过[爱发电](https://afdian.net/@zkqiang)支持我们的开源创作,资金将用于服务器开销以及今后的公共接口服务
125
+ 你可以扫描下方微信赞赏码支持我们的开源创作,资金将用于服务器及域名开销以及今后的公共接口服务。
126
126
 
127
- <a title="支持我们" href="https://afdian.net/@zkqiang" target="_blank">
128
- <img src="https://github.com/fluid-dev/static/blob/master/hexo-theme-fluid/afdian.png?s=300&v=4" width="300" alt="爱发电">
129
- </a>
127
+ <img src="https://github.com/fluid-dev/static/blob/master/hexo-theme-fluid/sponsor.png?s=200&v=4" width="200" alt="微信赞赏码">
130
128
 
131
- 其他商业赞助可发送邮件至 zkqiang#126.com (#替换为@)
129
+ 同时我们正在寻找商业赞助商,如果贵司想在本页展示广告位(每月 6K+ Views 定向流量曝光),或者有其他赞助形式,可将联系方式发送邮件至 zkqiang#126.com (#替换为@)
132
130
 
133
131
  ## 鸣谢
134
132
 
package/_config.yml CHANGED
@@ -183,11 +183,19 @@ color:
183
183
  board_color: "#fff"
184
184
  board_color_dark: "#252d38"
185
185
 
186
+ # 滚动条颜色
187
+ # Color of scrollbar
188
+ scrollbar_color: "#c4c6c9"
189
+ scrollbar_color_dark: "#687582"
190
+ scrollbar_hover_color: "#a6a6a6"
191
+ scrollbar_hover_color_dark: "#9da8b3"
192
+
186
193
  # 主题字体配置
187
194
  # Font
188
195
  font:
189
196
  font_size: 16px
190
197
  font_family:
198
+ letter_spacing: 0.02em
191
199
  code_font_size: 85%
192
200
 
193
201
  # 指定自定义 .js 文件路径,支持列表;路径是相对 source 目录,如 /js/custom.js 对应存放目录 source/js/custom.js
@@ -251,6 +259,12 @@ web_analytics: # 网页访问统计
251
259
  # REST API 服务器地址,国际版不填
252
260
  # Only the Chinese mainland users need to set
253
261
  server_url:
262
+ # 统计页面时获取路径的属性
263
+ # Get the attribute of the page path during statistics
264
+ path: window.location.pathname
265
+ # 开启后不统计本地路径( localhost 与 127.0.0.1 )
266
+ # If ture, ignore localhost & 127.0.0.1
267
+ ignore_local: false
254
268
 
255
269
  # 对页面中的图片和评论插件进行懒加载处理,可见范围外的元素不会提前加载
256
270
  # Lazy loading of images and comment plugin on the page
@@ -271,7 +285,7 @@ lazyload:
271
285
 
272
286
  # 图标库,包含了大量社交类图标,主题依赖的不包含在内,因此可自行修改,详见 https://hexo.fluid-dev.com/docs/icon/
273
287
  # Icon library, which includes many social icons, does not include those theme dependent, so your can modify link by yourself. See: https://hexo.fluid-dev.com/docs/en/icon/
274
- iconfont: //at.alicdn.com/t/font_1736178_kmeydafke9r.css
288
+ iconfont: //at.alicdn.com/t/font_1736178_lbnruvf0jn.css
275
289
 
276
290
 
277
291
  #---------------------------
@@ -362,6 +376,17 @@ scroll_down_arrow:
362
376
  scroll_top_arrow:
363
377
  enable: true
364
378
 
379
+ # Open Graph metadata
380
+ # See: https://hexo.io/docs/helpers.html#open-graph
381
+ open_graph:
382
+ enable: true
383
+ twitter_card: summary_large_image
384
+ twitter_id:
385
+ twitter_site:
386
+ google_plus:
387
+ fb_admins:
388
+ fb_app_id:
389
+
365
390
 
366
391
  #---------------------------
367
392
  # 页脚
@@ -518,13 +543,16 @@ post:
518
543
  format: "{} 字"
519
544
 
520
545
  # 估计阅读全文需要的时长
521
- # Estimate the time required to read the full text
546
+ # Estimated reading time
522
547
  min2read:
523
548
  enable: true
524
549
  format: "{} 分钟"
525
- # 每分钟阅读多少字,如果是技术文章,建议降低
526
- # Words read per minute
527
- words: 100
550
+ # 每个字词的长度,建议:中文≈2,英文≈5,中英混合可自行调节
551
+ # Average word length (chars count in word), ZH ≈ 2, EN ≈ 5
552
+ awl: 2
553
+ # 每分钟阅读字数,如果大部分是技术文章可适度调低
554
+ # Words per minute
555
+ wpm: 60
528
556
 
529
557
  # 浏览量计数
530
558
  # Number of visits
@@ -627,7 +655,7 @@ post:
627
655
  enable: false
628
656
  # 指定的插件,需要同时设置对应插件的必要参数
629
657
  # The specified plugin needs to set the necessary parameters at the same time
630
- # Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo
658
+ # Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis
631
659
  type: disqus
632
660
 
633
661
 
@@ -679,28 +707,32 @@ gitalk:
679
707
  pagerDirection: last
680
708
  distractionFreeMode: false
681
709
  createIssueManually: true
682
- # 默认 proxy 已失效,解决方法请见下方链接
683
- # The default proxy is invalid, please see the links for the solution
710
+ # 默认 proxy 可能会失效,解决方法请见下方链接
711
+ # The default proxy may be invalid, refer to the links for solutions
684
712
  # https://github.com/gitalk/gitalk/issues/429
685
713
  # https://github.com/Zibri/cloudflare-cors-anywhere
686
- proxy: <your own proxy>/https://github.com/login/oauth/access_token
714
+ proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token
687
715
 
688
716
  # Valine
689
717
  # 基于 LeanCloud
690
718
  # Based on LeanCloud
691
- # See: https://valine.js.org/configuration.html
719
+ # See: https://valine.js.org/
692
720
  valine:
693
- appid:
694
- appkey:
695
- placeholder: 说点什么
721
+ appId:
722
+ appKey:
696
723
  path: window.location.pathname
697
- avatar: retro
724
+ placeholder:
725
+ avatar: 'retro'
698
726
  meta: ['nick', 'mail', 'link']
727
+ requiredFields: []
699
728
  pageSize: 10
700
- lang: zh-CN
729
+ lang: 'zh-CN'
701
730
  highlight: false
702
731
  recordIP: false
703
- serverURLs:
732
+ serverURLs: ''
733
+ emojiCDN:
734
+ emojiMaps:
735
+ enableQQ: false
704
736
 
705
737
  # Waline
706
738
  # 从 Valine 衍生而来,额外增加了服务端和多种功能
@@ -708,19 +740,19 @@ valine:
708
740
  # See: https://waline.js.org/
709
741
  waline:
710
742
  serverURL: ''
711
- placeholder: 说点什么
712
743
  path: window.location.pathname
713
- avatar: retro
744
+ placeholder:
714
745
  meta: ['nick', 'mail', 'link']
746
+ requiredMeta: ['nick']
747
+ lang: 'zh-CN'
748
+ emoji: ['https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo']
749
+ dark: 'html[data-user-color-scheme="dark"]'
750
+ avatar: 'retro'
751
+ avatarCDN: 'https://seccdn.libravatar.org/avatar/'
752
+ avatarForce: false
753
+ wordLimit: 0
715
754
  pageSize: 10
716
- lang: zh-CN
717
755
  highlight: true
718
- avatarCDN:
719
- avatarForce: false
720
- requiredFields: []
721
- emojiCDN: ''
722
- emojiMaps: {}
723
- anonymous:
724
756
 
725
757
  # 畅言 Changyan
726
758
  # 基于第三方的服务
@@ -746,6 +778,7 @@ remark42:
746
778
  site_id:
747
779
  max_shown_comments: 10
748
780
  locale: zh
781
+ components: ['embed']
749
782
 
750
783
  # Twikoo
751
784
  # 基于腾讯云开发
@@ -756,6 +789,15 @@ twikoo:
756
789
  region: ap-shanghai
757
790
  path: window.location.pathname
758
791
 
792
+ # Cusdis
793
+ # 基于第三方服务或自托管服务
794
+ # Based on third-party or self-hosted service
795
+ # See https://cusdis.com
796
+ cusdis:
797
+ host:
798
+ app_id:
799
+ lang: zh-cn
800
+
759
801
  #---------------------------
760
802
  # 归档页
761
803
  # Archive Page
@@ -909,7 +951,7 @@ links:
909
951
  enable: false
910
952
  # 指定的插件,需要同时设置对应插件的必要参数
911
953
  # The specified plugin needs to set the necessary parameters at the same time
912
- # Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo
954
+ # Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis
913
955
  type: disqus
914
956
 
915
957
 
@@ -930,44 +972,44 @@ static_prefix:
930
972
  internal_css: /css
931
973
  internal_img: /img
932
974
 
933
- anchor: https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/
975
+ anchor: https://cdn.jsdelivr.net/npm/anchor-js@4/
934
976
 
935
- github_markdown: https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/
977
+ github_markdown: https://cdn.jsdelivr.net/npm/github-markdown-css@4/
936
978
 
937
- jquery: https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/
979
+ jquery: https://cdn.jsdelivr.net/npm/jquery@3/dist/
938
980
 
939
- bootstrap: https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/
981
+ bootstrap: https://cdn.jsdelivr.net/npm/bootstrap@4/dist/
940
982
 
941
- highlightjs: https://cdn.jsdelivr.net/npm/highlight.js@10.6.0/
983
+ highlightjs: https://cdn.jsdelivr.net/npm/highlight.js@10/
942
984
 
943
- prismjs: https://cdn.jsdelivr.net/npm/prismjs@1.23.0/
985
+ prismjs: https://cdn.jsdelivr.net/npm/prismjs@1/
944
986
 
945
- tocbot: https://cdn.jsdelivr.net/npm/tocbot@4.12.2/dist/
987
+ tocbot: https://cdn.jsdelivr.net/npm/tocbot@4/dist/
946
988
 
947
- typed: https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/
989
+ typed: https://cdn.jsdelivr.net/npm/typed.js@2/lib/
948
990
 
949
- fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/
991
+ fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/
950
992
 
951
- nprogress: https://cdn.jsdelivr.net/npm/nprogress@0.2.0/
993
+ nprogress: https://cdn.jsdelivr.net/npm/nprogress@0/
952
994
 
953
- mathjax: https://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/
995
+ mathjax: https://cdn.jsdelivr.net/npm/mathjax@3/es5/
954
996
 
955
- katex: https://cdn.jsdelivr.net/npm/katex@0.13.0/dist/
997
+ katex: https://cdn.jsdelivr.net/npm/katex@0/dist/
956
998
 
957
999
  busuanzi: https://busuanzi.ibruce.info/busuanzi/2.3/
958
1000
 
959
- clipboard: https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/
1001
+ clipboard: https://cdn.jsdelivr.net/npm/clipboard@2/dist/
960
1002
 
961
- mermaid: https://cdn.jsdelivr.net/npm/mermaid@8.9.2/dist/
1003
+ mermaid: https://cdn.jsdelivr.net/npm/mermaid@8/dist/
962
1004
 
963
- valine: https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/
1005
+ valine: https://cdn.jsdelivr.net/npm/valine@1/dist/
964
1006
 
965
- waline: https://cdn.jsdelivr.net/npm/@waline/client@0.14.8/dist/
1007
+ waline: https://cdn.jsdelivr.net/npm/@waline/client@1/dist/
966
1008
 
967
- gitalk: https://cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/
1009
+ gitalk: https://cdn.jsdelivr.net/npm/gitalk@1/dist/
968
1010
 
969
- disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1.3.0/dist/
1011
+ disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1/dist/
970
1012
 
971
- twikoo: https://cdn.jsdelivr.net/npm/twikoo@1.3.0/dist/
1013
+ twikoo: https://cdn.jsdelivr.net/npm/twikoo@1/dist/
972
1014
 
973
- hint: /lib/hint/
1015
+ hint: https://cdn.jsdelivr.net/npm/hint.css@2/
@@ -0,0 +1,44 @@
1
+ search:
2
+ title: Serĉi
3
+ keyword: ŝlosivorto
4
+ status:
5
+ success: v
6
+ error: x
7
+
8
+ postTotal: Entute %d afiŝoj
9
+
10
+ paginator:
11
+ pre: Antaŭa paĝo
12
+ next: Sekva paĝo
13
+
14
+ post:
15
+ toc: Enhavtabelo
16
+ pre: Antaŭa afiŝo
17
+ next: Sekva afiŝo
18
+
19
+ home:
20
+ title: Hejmpaĝo
21
+
22
+ archive:
23
+ title: Arkivoj
24
+ subtitle: Arkivo
25
+
26
+ tag:
27
+ title: Etikedoj
28
+ subtitle: Etikedo
29
+
30
+ category:
31
+ title: Kategorioj
32
+ subtitle: Kategorio
33
+
34
+ about:
35
+ title: Pri
36
+ subtitle: Pri
37
+
38
+ page404:
39
+ title: Paĝo ne trovita
40
+ subtitle: Ho ve, Paĝo ne trovita~
41
+
42
+ links:
43
+ title: Ligoj
44
+ subtitle: Ligoj de amikeco
@@ -7,9 +7,9 @@
7
7
  <% dateCursor = date(post.date, "YYYY") %>
8
8
  <p class="h5"><%= dateCursor %></p>
9
9
  <% } %>
10
- <a href="<%- url_for(post.path) %>" class="list-group-item list-group-item-action">
10
+ <a href="<%= url_for(post.path) %>" class="list-group-item list-group-item-action">
11
11
  <span class="archive-post-title"><%= post.title %></span>
12
- <time style="float: right;"><%- date(post.date, "MM-DD") %></time>
12
+ <time style="float: right;"><%= date(post.date, "MM-DD") %></time>
13
13
  </a>
14
14
  <% }) %>
15
15
  </div>
@@ -10,14 +10,14 @@
10
10
  <% if(theme.footer.beian.police_code) { %>
11
11
  <span>
12
12
  <a
13
- href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%- theme.footer.beian.police_code %>"
13
+ href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%= theme.footer.beian.police_code %>"
14
14
  rel="nofollow noopener"
15
15
  class="beian-police"
16
16
  target="_blank"
17
17
  >
18
18
  <% if(theme.footer.beian.police_icon) { %>
19
19
  <span style="visibility: hidden; width: 0">|</span>
20
- <img src="<%- url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
20
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
21
21
  <% } %>
22
22
  <span><%- theme.footer.beian.police_text %></span>
23
23
  </a>
@@ -26,7 +26,7 @@
26
26
  <span class="beian-police">
27
27
  <% if(theme.footer.beian.police_icon) { %>
28
28
  <span style="visibility: hidden; width: 0">|</span>
29
- <img src="<%- url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
29
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
30
30
  <% } %>
31
31
  <span class="beian-police"><%- theme.footer.beian.police_text %></span>
32
32
  </span>
@@ -2,19 +2,9 @@
2
2
  <div id="SOHUCS" sid='<%= page.permalink %>'></div>
3
3
  <script type="text/javascript">
4
4
  Fluid.utils.loadComments('#SOHUCS', function() {
5
- var appid = '<%= theme.changyan.appid %>';
6
- var conf = '<%= theme.changyan.appkey %>';
7
- var width = window.innerWidth || document.documentElement.clientWidth;
8
- if (width < 960) {
9
- window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
10
- } else {
11
- Fluid.utils.createScript("https://changyan.sohu.com/upload/changyan.js", function() {
12
- window.changyan.api.config({
13
- appid: appid,
14
- conf: conf
15
- })
16
- });
17
- }
5
+ Fluid.utils.createScript("https://changyan.sohu.com/upload/changyan.js", function() {
6
+ window.changyan.api.config(<%- JSON.stringify(theme.changyan || {}) %>)
7
+ });
18
8
  });
19
9
  </script>
20
10
  <noscript>Please enable JavaScript to view the comments</noscript>
@@ -0,0 +1,25 @@
1
+ <% if (theme.cusdis.host && theme.cusdis.app_id) { %>
2
+ <div class="cusdis" style="width:100%">
3
+ <div id="cusdis_thread"
4
+ data-host="<%= theme.cusdis.host %>"
5
+ data-app-id="<%= theme.cusdis.app_id %>"
6
+ data-page-id="<%= md5(page.path) %>"
7
+ data-page-url="<%= page.path %>"
8
+ data-page-title="<%= page.title %>"
9
+ data-theme="<%= theme.dark_mode.default %>"
10
+ >
11
+ </div>
12
+ </div>
13
+ <script type="text/javascript">
14
+ Fluid.utils.loadComments('#cusdis_thread', function() {
15
+ Fluid.utils.createScript('<%= url_join(theme.cusdis.host,
16
+ `/js/widget/lang/${ String(theme.cusdis.lang || 'zh-cn').toLowerCase() }.js`) %>');
17
+ Fluid.utils.createScript('<%= url_join(theme.cusdis.host, 'js/cusdis.es.js') %>');
18
+ var schema = document.documentElement.getAttribute('data-user-color-scheme');
19
+ if (schema) {
20
+ document.querySelector('#cusdis_thread').dataset.theme = schema
21
+ }
22
+ });
23
+ </script>
24
+ <noscript>Please enable JavaScript to view the comments</noscript>
25
+ <% } %>
@@ -21,7 +21,7 @@
21
21
  };
22
22
  Fluid.utils.loadComments('#disqus_thread', function() {
23
23
  var d = document, s = d.createElement('script');
24
- s.src = '//' + '<%- theme.disqus.shortname %>' + '.disqus.com/embed.js';
24
+ s.src = '//' + '<%= theme.disqus.shortname %>' + '.disqus.com/embed.js';
25
25
  s.setAttribute('data-timestamp', new Date());
26
26
  (d.head || d.body).appendChild(s);
27
27
  });
@@ -3,22 +3,14 @@
3
3
  <script type="text/javascript">
4
4
  Fluid.utils.loadComments('#gitalk-container', function() {
5
5
  Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.internal_css, 'gitalk.css') %>')
6
- Fluid.utils.createScript('<%= url_join(theme.static_prefix.gitalk, 'gitalk.min.js') %>', function () {
7
- var gitalk = new Gitalk({
8
- clientID: '<%= theme.gitalk.clientID %>',
9
- clientSecret: '<%= theme.gitalk.clientSecret %>',
10
- repo: '<%= theme.gitalk.repo %>',
11
- owner: '<%= theme.gitalk.owner %>',
12
- admin: <%- JSON.stringify(theme.gitalk.admin || []) %>,
13
- id: '<%= md5(page.path) %>',
14
- language: '<%= theme.gitalk.language %>',
15
- labels: <%- JSON.stringify(theme.gitalk.labels || []) %>,
16
- perPage: <%= theme.gitalk.perPage %>,
17
- pagerDirection: '<%= theme.gitalk.pagerDirection %>',
18
- createIssueManually: <%= theme.gitalk.createIssueManually %>,
19
- distractionFreeMode: <%= theme.gitalk.distractionFreeMode %>,
20
- proxy: '<%= theme.gitalk.proxy %>'
21
- });
6
+ Fluid.utils.createScript('<%= url_join(theme.static_prefix.gitalk, 'gitalk.min.js') %>', function() {
7
+ var options = Object.assign(
8
+ <%- JSON.stringify(theme.gitalk || {}) %>,
9
+ {
10
+ id: '<%= md5(page.path) %>'
11
+ }
12
+ )
13
+ var gitalk = new Gitalk(options);
22
14
  gitalk.render('gitalk-container');
23
15
  });
24
16
  });
@@ -5,16 +5,14 @@
5
5
  if (schema !== 'light' && schema !== 'dark') {
6
6
  schema = 'light';
7
7
  }
8
- var remark_config = {
9
- host: '<%= theme.remark42.host %>',
10
- site_id: '<%= theme.remark42.site_id %>',
11
- components: ['embed'],
12
- url: '<%= url_for(page.path) %>',
13
- max_shown_comments: '<%= theme.remark42.max_shown_comments %>',
14
- theme: schema,
15
- page_title: '<%= page.title %>',
16
- locale: '<%= theme.remark42.locale %>'
17
- };
8
+ var remark_config = Object.assign(
9
+ <%- JSON.stringify(theme.remark42 || {}) %>,
10
+ {
11
+ url: '<%= url_for(page.path) %>',
12
+ page_title: '<%= page.title %>',
13
+ theme: schema,
14
+ }
15
+ );
18
16
 
19
17
  Fluid.utils.loadComments('#remark42', function() {
20
18
  (function (c) {
@@ -3,12 +3,17 @@
3
3
  <script type="text/javascript">
4
4
  Fluid.utils.loadComments('#comments', function() {
5
5
  Fluid.utils.createScript('<%= url_join(theme.static_prefix.twikoo, 'twikoo.all.min.js') %>', function() {
6
- twikoo.init({
7
- el: '#twikoo',
8
- envId: '<%= theme.twikoo.envId %>',
9
- region: '<%= theme.twikoo.region %>',
10
- path: '<%= theme.twikoo.path %>',
11
- })
6
+ var options = Object.assign(
7
+ <%- JSON.stringify(theme.twikoo || {}) %>,
8
+ {
9
+ el: '#twikoo',
10
+ path: '<%= theme.twikoo.path %>',
11
+ onCommentLoaded: function() {
12
+ Fluid.plugins.initFancyBox('#twikoo .tk-content img:not(.tk-owo-emotion)');
13
+ }
14
+ }
15
+ )
16
+ twikoo.init(options)
12
17
  });
13
18
  });
14
19
  </script>
@@ -1,22 +1,19 @@
1
- <% if (theme.valine.appid && theme.valine.appkey) { %>
1
+ <% if (theme.valine.appId && theme.valine.appKey) { %>
2
2
  <div id="valine"></div>
3
3
  <script type="text/javascript">
4
4
  Fluid.utils.loadComments('#valine', function() {
5
- Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine, 'Valine.min.js') %>', function () {
6
- new Valine({
7
- el: "#valine",
8
- app_id: "<%= theme.valine.appid %>",
9
- app_key: "<%= theme.valine.appkey %>",
10
- placeholder: "<%= theme.valine.placeholder %>",
11
- path: <%= theme.valine.path %>,
12
- avatar: "<%= theme.valine.avatar %>",
13
- meta: <%- JSON.stringify(theme.valine.meta || []) %>,
14
- pageSize: "<%= theme.valine.pageSize %>",
15
- lang: "<%= theme.valine.lang %>",
16
- highlight: <%= theme.valine.highlight %>,
17
- recordIP: <%= theme.valine.recordIP %>,
18
- serverURLs: "<%= theme.valine.serverURLs %>",
19
- });
5
+ Fluid.utils.createScript('<%= url_join(theme.static_prefix.valine, 'Valine.min.js') %>', function() {
6
+ var options = Object.assign(
7
+ <%- JSON.stringify(theme.valine || {}) %>,
8
+ {
9
+ el: "#valine",
10
+ path: <%= theme.valine.path %>
11
+ }
12
+ )
13
+ new Valine(options);
14
+ Fluid.utils.waitElementVisible('#valine .vcontent', () => {
15
+ Fluid.plugins.initFancyBox('#valine .vcontent img:not(.vemoji)');
16
+ })
20
17
  });
21
18
  });
22
19
  </script>
@@ -2,24 +2,18 @@
2
2
  <div id="waline"></div>
3
3
  <script type="text/javascript">
4
4
  Fluid.utils.loadComments('#waline', function() {
5
- Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'Waline.min.js') %>', function () {
6
- new Waline({
7
- el: "#waline",
8
- placeholder: "<%= theme.waline.placeholder %>",
9
- path: <%= theme.waline.path %>,
10
- avatar: "<%= theme.waline.avatar %>",
11
- meta: <%- JSON.stringify(theme.waline.meta || []) %>,
12
- pageSize: "<%= theme.waline.pageSize %>",
13
- lang: "<%= theme.waline.lang %>",
14
- highlight: <%= theme.waline.highlight %>,
15
- serverURL: "<%= theme.waline.serverURL %>",
16
- avatarCDN: "<%= theme.waline.avatarCDN %>",
17
- avatarForce: <%= theme.waline.avatarForce %>,
18
- requiredFields: <%- JSON.stringify(theme.waline.requiredFields || []) %>,
19
- emojiCDN: "<%= theme.waline.emojiCDN %>",
20
- emojiMaps: <%- JSON.stringify(theme.waline.emojiMaps) %>,
21
- anonymous: <%= theme.waline.anonymous || 'null' %>,
22
- });
5
+ Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'Waline.min.js') %>', function() {
6
+ var options = Object.assign(
7
+ <%- JSON.stringify(theme.waline || {}) %>,
8
+ {
9
+ el: '#waline',
10
+ path: <%= theme.waline.path %>
11
+ }
12
+ )
13
+ new Waline(options);
14
+ Fluid.utils.waitElementVisible('#waline .vcontent', () => {
15
+ Fluid.plugins.initFancyBox('#waline .vcontent img:not(.vemoji)');
16
+ })
23
17
  });
24
18
  });
25
19
  </script>
@@ -7,7 +7,7 @@
7
7
  <% if (theme.code.highlight.enable) { %>
8
8
  <% var cssName %>
9
9
  <% if (theme.code.highlight.lib === 'highlightjs') { %>
10
- <% cssName = theme.code.highlight.highlightjs.style.toLowerCase().replace(/(?<!([0-9]))\s(?!([0-9]))/g, '-').replace(/\s/g, '') %>
10
+ <% cssName = theme.code.highlight.highlightjs.style.toLowerCase().replace(/([^0-9])\s([^0-9])/g, '$1-$2').replace(/\s/g, '') %>
11
11
  <%- css_ex(theme.static_prefix.highlightjs, `/styles/${ cssName }.min.css`) %>
12
12
  <% } else if (theme.code.highlight.lib === 'prismjs') { %>
13
13
  <% var style = theme.code.highlight.prismjs.style %>
@@ -29,10 +29,9 @@
29
29
  <% } %>
30
30
  <% } %>
31
31
 
32
- <% if ((is_post() || (is_page() && page.image_zoom)) && theme.post.image_zoom.enable) { %>
32
+ <% if (theme.post.image_zoom.enable && page.image_zoom !== false) { %>
33
33
  <%- css_ex(theme.static_prefix.fancybox, 'jquery.fancybox.min.css') %>
34
34
  <% } %>
35
-
36
35
  <% } %>
37
36
 
38
37
  <!-- 主题依赖的图标库,不要自行修改 -->
@@ -6,6 +6,6 @@
6
6
  <%- partial('_partial/beian.ejs') %>
7
7
  <% if(theme.web_analytics.cnzz) { %>
8
8
  <!-- cnzz Analytics Icon -->
9
- <span id="cnzz_stat_icon_<%- theme.web_analytics.cnzz %>" style="display: none"></span>
9
+ <span id="cnzz_stat_icon_<%= theme.web_analytics.cnzz %>" style="display: none"></span>
10
10
  <% } %>
11
11
  </footer>
@@ -5,28 +5,31 @@ var keywords = page.keywords || config.keywords
5
5
  if (keywords instanceof Array) {
6
6
  keywords = keywords.join(',')
7
7
  }
8
- var description = config.description
9
- if (page.description) {
10
- description = page.description
11
- } else if(page.excerpt) {
12
- description = strip_html(page.excerpt).substr(0, 200)
8
+ var description = page.description || page.excerpt || (is_post() && page.content) || config.description
9
+ if (description) {
10
+ description = escape_html(strip_html(description).substring(0, 200).trim()).replace(/\n/g, ' ')
13
11
  }
12
+ var ogImage = page.og_img || page.index_img
13
+ var ogConfig = Object.assign({ image: ogImage && url_for(ogImage) }, theme.open_graph)
14
14
  %>
15
15
 
16
16
  <head>
17
17
  <meta charset="UTF-8">
18
- <link rel="apple-touch-icon" sizes="76x76" href="<%- url_for(theme.apple_touch_icon) %>">
19
- <link rel="icon" href="<%- url_for(theme.favicon) %>">
20
- <meta name="viewport"
21
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
18
+ <link rel="apple-touch-icon" sizes="76x76" href="<%= url_for(theme.apple_touch_icon) %>">
19
+ <link rel="icon" href="<%= url_for(theme.favicon) %>">
20
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
22
21
  <meta http-equiv="x-ua-compatible" content="ie=edge">
23
22
  <% if (theme.force_https) { %>
24
23
  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
25
24
  <% } %>
26
25
  <meta name="theme-color" content="<%= theme.color.navbar_bg_color %>">
27
- <meta name="description" content="<%= description %>">
28
26
  <meta name="author" content="<%= page.author || config.author %>">
29
27
  <meta name="keywords" content="<%= keywords %>">
28
+ <% if (theme.open_graph.enable) { %>
29
+ <%- open_graph(ogConfig) %>
30
+ <% } else { %>
31
+ <meta name="description" content="<%= description %>">
32
+ <% } %>
30
33
  <% if (theme.custom_head) { %>
31
34
  <%- theme.custom_head %>
32
35
  <% } %>