hexo-theme-volantis 5.8.1 → 6.0.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 (112) hide show
  1. package/CHANGELOG.md +3 -44
  2. package/_cdn.yml +449 -0
  3. package/_config.yml +155 -157
  4. package/languages/en.yml +9 -10
  5. package/languages/zh-CN.yml +11 -15
  6. package/languages/zh-TW.yml +10 -11
  7. package/layout/_meta/category.ejs +10 -5
  8. package/layout/_meta/counter.ejs +14 -17
  9. package/layout/_meta/tags.ejs +3 -0
  10. package/layout/_meta/walinecount.ejs +1 -1
  11. package/layout/_partial/article.ejs +8 -3
  12. package/layout/_partial/cover.ejs +4 -4
  13. package/layout/_partial/footer.ejs +1 -1
  14. package/layout/_partial/head.ejs +7 -18
  15. package/layout/_partial/header.ejs +6 -6
  16. package/layout/_partial/post.ejs +3 -3
  17. package/layout/_partial/scripts/_ctrl.ejs +43 -2
  18. package/layout/_partial/scripts/config.ejs +69 -0
  19. package/layout/_partial/scripts/global.ejs +137 -60
  20. package/layout/_partial/scripts/index.ejs +16 -23
  21. package/layout/_plugins/_page_plugins/artitalk/index.ejs +1 -1
  22. package/layout/_plugins/_page_plugins/bbtalk/index.ejs +1 -1
  23. package/layout/_plugins/_page_plugins/fcircle/index.ejs +9 -8
  24. package/layout/_plugins/_page_plugins/katex/index.ejs +3 -3
  25. package/layout/_plugins/_page_plugins/mathjax/index.ejs +1 -1
  26. package/layout/_plugins/aplayer/layout.ejs +31 -23
  27. package/layout/_plugins/aplayer/script.ejs +93 -65
  28. package/layout/_plugins/comments/artalk/script.ejs +31 -40
  29. package/layout/_plugins/comments/discuss/script.ejs +1 -1
  30. package/layout/_plugins/comments/disqusjs/script.ejs +2 -2
  31. package/layout/_plugins/comments/gitalk/script.ejs +1 -1
  32. package/layout/_plugins/comments/twikoo/script.ejs +1 -1
  33. package/layout/_plugins/comments/vssue/script.ejs +3 -3
  34. package/layout/_plugins/comments/waline/script.ejs +2 -2
  35. package/layout/_plugins/github-api/script.ejs +3 -3
  36. package/layout/_plugins/lazyload/script.ejs +1 -1
  37. package/layout/_plugins/nodewaves/script.ejs +1 -1
  38. package/layout/_plugins/pace/script.ejs +15 -0
  39. package/layout/_plugins/parallax/script.ejs +1 -1
  40. package/layout/_plugins/pjax/index.ejs +66 -11
  41. package/layout/_plugins/pjax/pdata.ejs +5 -5
  42. package/layout/_plugins/preload/script.ejs +2 -2
  43. package/layout/_plugins/rightmenus/layout.ejs +4 -4
  44. package/layout/_plugins/scrollreveal/script.ejs +2 -2
  45. package/layout/_plugins/search/script.ejs +11 -8
  46. package/layout/_plugins/swiper/script.ejs +2 -2
  47. package/layout/{_partial/scripts/toc.ejs → _plugins/toc/script.ejs} +40 -36
  48. package/layout/_widget/webinfo.ejs +13 -14
  49. package/layout/friends.ejs +2 -2
  50. package/layout/layout.ejs +1 -15
  51. package/package.json +4 -4
  52. package/scripts/events/lib/cdn.js +206 -0
  53. package/scripts/events/lib/check-configuration.js +7 -7
  54. package/scripts/events/lib/check-environment.js +17 -17
  55. package/scripts/events/lib/config.js +0 -24
  56. package/scripts/events/lib/render-stylus.js +5 -5
  57. package/scripts/events/lib/stellar-tag-utils.js +2 -2
  58. package/scripts/filters/hexo-blog-encrypt-callback.js +44 -0
  59. package/scripts/filters/img.js +1 -1
  60. package/scripts/filters/replace.js +3 -3
  61. package/scripts/filters/z-lazyload.js +3 -5
  62. package/scripts/helpers/first-style.js +2 -2
  63. package/scripts/helpers/head/generate_seo.js +11 -9
  64. package/scripts/helpers/head/generate_title__keywords__description.js +19 -6
  65. package/scripts/helpers/related-posts.js +3 -3
  66. package/scripts/helpers/structured-data/lib/blogposting.js +1 -1
  67. package/scripts/helpers/structured-data/lib/breadcrumblist.js +1 -1
  68. package/scripts/helpers/structured-data/lib/config.js +1 -1
  69. package/scripts/helpers/structured-data/lib/website.js +1 -1
  70. package/scripts/helpers//346/226/207/347/253/240/346/216/250/350/215/220.js +184 -0
  71. package/scripts/tags/btn.js +2 -2
  72. package/scripts/tags/btns.js +3 -3
  73. package/scripts/tags/checkbox.js +6 -6
  74. package/scripts/tags/contributors.js +7 -7
  75. package/scripts/tags/dropmenu.js +8 -8
  76. package/scripts/tags/fancybox.js +6 -6
  77. package/scripts/tags/folding.js +5 -5
  78. package/scripts/tags/frame.js +3 -3
  79. package/scripts/tags/friends.js +8 -8
  80. package/scripts/tags/ghcard.js +7 -7
  81. package/scripts/tags/image.js +6 -6
  82. package/scripts/tags/inline-labels.js +6 -6
  83. package/scripts/tags/link.js +5 -5
  84. package/scripts/tags/md.js +4 -4
  85. package/scripts/tags/media.js +5 -5
  86. package/scripts/tags/note.js +12 -12
  87. package/scripts/tags/pandown.js +29 -29
  88. package/scripts/tags/site.js +4 -4
  89. package/scripts/tags/span.js +4 -4
  90. package/scripts/tags/table.js +2 -2
  91. package/scripts/tags/tabs.js +23 -23
  92. package/scripts/tags/timeline.js +5 -5
  93. package/source/css/_first/base_first.styl +1 -1
  94. package/source/css/_style/_layout/article.styl +43 -0
  95. package/source/css/_style/_layout/main.styl +1 -1
  96. package/source/css/_style/_layout/search.styl +206 -14
  97. package/source/css/_style/_plugins/index.styl +1 -3
  98. package/source/js/app.js +133 -160
  99. package/source/js/plugins/parallax.js +1 -1
  100. package/source/js/plugins/rightMenus.js +24 -20
  101. package/source/js/search/algolia.js +239 -0
  102. package/source/js/search/hexo.js +8 -2
  103. package/source/js/search/meilisearch.js +220 -0
  104. package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +0 -127
  105. package/layout/_partial/scripts/_ctrl/coverCtrl.ejs +0 -43
  106. package/layout/_plugins/analytics/LCCounter.ejs +0 -207
  107. package/layout/_plugins/pjax/animate.ejs +0 -31
  108. package/layout/_plugins/rightmenu/layout.ejs +0 -119
  109. package/scripts/helpers/revisioned.js +0 -167
  110. package/source/css/_style/_plugins/pjaxanimate.styl +0 -160
  111. package/source/js/plugins/rightMenu.js +0 -577
  112. /package/layout/{_partial/scripts/content-visibility-scroll-fix.ejs → _plugins/content-visibility/script.ejs} +0 -0
@@ -2,6 +2,7 @@ navbar:
2
2
  archive: 归档
3
3
  category: 分类
4
4
  tag: 标签
5
+
5
6
  post:
6
7
  pin: 置顶
7
8
  readmore: 阅读全文
@@ -27,8 +28,9 @@ post:
27
28
  updated: 更新于
28
29
  references: 原文出处
29
30
  license: 许可协议
31
+
30
32
  footer:
31
- license: '博客内容遵循 [署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)'
33
+ license: '博客内容遵循 [署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 协议](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans)'
32
34
  use: 本站使用
33
35
  theme: 作为主题
34
36
  total_views: 总访问量为
@@ -36,6 +38,7 @@ footer:
36
38
  times: 次
37
39
  site_source: 本站使用 %s 作为主题,您可以在 %s 找到[本站源码](%s)。
38
40
  site_views: 总访问量约为 %s 次,访问人数约为 %s 人。
41
+
39
42
  symbol:
40
43
  comma: ","
41
44
  period: "。"
@@ -43,22 +46,15 @@ symbol:
43
46
  brackets_l: "("
44
47
  brackets_r: ")"
45
48
 
46
- rightmenu:
47
- back: "返回"
48
- forward: "前进"
49
- reload: "刷新"
50
- search_word: "站内搜索"
51
- copy_text: "复制文本"
52
- copy_paste: "粘贴文本"
53
- copy_select: "全选文本"
54
- copy_cut: "剪切文本"
55
- copy_image_src: "复制图片地址"
56
- copy_image_file: "复制图片文件"
57
- copy_link: "复制链接"
58
- open_in_new_tab: "在新标签页打开"
59
-
60
49
  kill:
61
50
  title: "抱歉,您的浏览器无法访问本站"
62
51
  more: "了解详情 >"
63
52
  noscript: "本页面需要浏览器支持(启用)JavaScript"
64
53
  ie: "微软已经于2016年终止了对 Internet Explorer (IE) 10 及更早版本的支持,<br/>继续使用存在极大的安全隐患,请使用当代主流的浏览器进行访问。"
54
+
55
+ search:
56
+ title: 搜索
57
+ load_data: 数据库加载中
58
+ hits_empty: '找不到您查询的内容:${query}'
59
+ hits_stats: '找到 ${hits} 条结果,用时 ${time} 毫秒'
60
+
@@ -2,6 +2,7 @@ navbar:
2
2
  archive: 歸檔
3
3
  category: 分類
4
4
  tag: 標籤
5
+
5
6
  post:
6
7
  pin: 置頂
7
8
  readmore: 閱讀全文
@@ -23,8 +24,9 @@ post:
23
24
  link: 文章連結
24
25
  license_title: 版權聲明
25
26
  license_content: "本網誌所有文章除特別聲明外,均採用 %s 許可協議。轉載請註明出處!"
27
+
26
28
  footer:
27
- license: '博客內容遵循 [姓名標示-非商業性-相同方式分享 4.0 國際 (CC BY-NC-SA 4.0) 協議](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh_TW)'
29
+ license: '博客內容遵循 [姓名標示-非商業性-相同方式分享 4.0 國際 (CC BY-NC-SA 4.0) 協議](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hant)'
28
30
  use: 本站使用
29
31
  theme: 作為主題
30
32
  total_views: 總訪問量為
@@ -32,6 +34,7 @@ footer:
32
34
  times: 次
33
35
  site_source: 本站使用 %s 作為主題,您可以在 %s 找到[本站源碼](%s)。
34
36
  site_views: 總訪問量約為 %s 次,訪問人數約為 %s 人。
37
+
35
38
  symbol:
36
39
  comma: ","
37
40
  period: "。"
@@ -39,18 +42,14 @@ symbol:
39
42
  brackets_l: "("
40
43
  brackets_r: ")"
41
44
 
42
- rightmenu:
43
- back: "返回"
44
- forward: "前进"
45
- reload: "刷新"
46
- search_word: "站內搜索"
47
- copy_text: "複製文本"
48
- copy_image_src: "複製圖片地址"
49
- copy_link: "複製鏈接"
50
- open_in_new_tab: "在新標籤頁打開"
51
-
52
45
  kill:
53
46
  title: "抱歉,您的瀏覽器無法訪問本站"
54
47
  more: "了解詳情 >"
55
48
  noscript: "本頁面需要瀏覽器支持(啟用)JavaScript"
56
49
  ie: "微軟已經於2016年終止了對 Internet Explorer (IE) 10 及更早版本的支持,<br/>繼續使用存在極大的安全隱患,請使用當代主流的瀏覽器進行訪問。"
50
+
51
+ search:
52
+ title: 搜尋
53
+ load_data: 資料庫載入中
54
+ hits_empty: '找不到您查詢的內容:${query}'
55
+ hits_stats: '找到 ${hits} 條結果,用時 ${time} 毫秒'
@@ -1,15 +1,20 @@
1
1
  <% if (post.categories && post.categories.length){ %>
2
+ <% try { %>
3
+ <%# 在 _posts/ 外使用 categories 会报错 %>
4
+ <% const show_categories = list_categories(post.categories, {
5
+ show_count: false,
6
+ separator: '<span class="sep"></span>',
7
+ style: 'none'
8
+ }) %>
2
9
  <div class='new-meta-item category'>
3
10
  <i class="<%- theme.article.body.meta_library.category.icon %> fa-fw" aria-hidden="true"></i>
4
- <%- list_categories(post.categories, {
5
- show_count: false,
6
- separator: '<span class="sep"></span>',
7
- style: 'none'
8
- }) %>
11
+ <%- show_categories %>
9
12
  <% for(cat of post.categories.toArray()){ %>
10
13
  <span hidden itemprop="about" itemscope itemtype="http://schema.org/Thing">
11
14
  <a href="<%- url_for(cat.path) %>" itemprop="url"><span itemprop="name"><%- cat.name %></span></a>
12
15
  </span>
13
16
  <% } %>
14
17
  </div>
18
+ <% }catch (error) {} %>
15
19
  <% } %>
20
+
@@ -14,12 +14,11 @@
14
14
  path = path.replaceAll('/index.html', '/').replaceAll('.html', '')
15
15
 
16
16
  let checkComment = false;
17
- if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id
18
- || theme.analytics.busuanzi
19
- || theme.comments.service=='waline' && theme.comments.waline.pageview
20
- || theme.comments.service=='twikoo'
21
- || theme.comments.service=='discuss'
22
- || theme.comments.service=='artalk') {
17
+ if (theme.plugins.busuanzi.enable
18
+ || (theme.comments.service=='waline' && theme.comments.waline.pageview)
19
+ || (theme.comments.service=='twikoo' && theme.comments.twikoo.visitor)
20
+ || (theme.comments.service=='discuss' && theme.comments.discuss.visitStat)
21
+ || (theme.comments.service=='artalk' && theme.comments.artalk.visitor)) {
23
22
  checkComment = !checkComment;
24
23
  }
25
24
  %>
@@ -29,29 +28,27 @@
29
28
  <a class='notlink'>
30
29
  <p>
31
30
  <i class="<%- theme.article.body.meta_library.counter.icon %> fa-fw" aria-hidden="true"></i>
32
- <% if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id) { %>
33
- <span id="lc-pv" data-title="<%- post.title || page.title %>" data-path="<%- url_for(path) %>">
34
- <span id='number'><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
35
- </span>
36
- <% } else if (theme.analytics.busuanzi) { %>
37
- <span id="busuanzi_value_page_pv"><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
38
- <% } else if (theme.comments.service=='waline' && theme.comments.waline.pageview) { %>
31
+ <% if (theme.comments.service=='waline' && theme.comments.waline.pageview) { %>
39
32
  <span data-path="<%- url_for(path) %>" class="waline-pageview-count">
40
33
  <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
41
34
  </span>
42
- <% } else if (theme.comments.service=='twikoo') { %>
35
+ <% } else if (theme.comments.service=='twikoo' && theme.comments.twikoo.visitor) { %>
43
36
  <span id="twikoo_visitors">
44
37
  <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
45
38
  </span>
46
- <% } else if (theme.comments.service=='discuss') { %>
39
+ <% } else if (theme.comments.service=='discuss' && theme.comments.discuss.visitStat) { %>
47
40
  <span id="Discuss-Visitors">
48
41
  <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
49
42
  </span>
50
- <% } else if (theme.comments.service=='artalk') { %>
43
+ <% } else if (theme.comments.service=='artalk' && theme.comments.artalk.visitor) { %>
51
44
  <span id="artalk_visitors" data-page-key="<%- url_for(path) %>">
52
45
  <i class="fa-light fa-loader fa-spin fa-fw" aria-hidden="true"></i>
53
46
  </span>
54
- <% } %>
47
+ <% } else if (theme.plugins.busuanzi.enable) { %>
48
+ <span id="busuanzi_value_page_pv">
49
+ <i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i>
50
+ </span>
51
+ <% } %>
55
52
  <span><%- theme.article.body.meta_library.counter.unit %></span>
56
53
  </p>
57
54
  </a>
@@ -1,4 +1,6 @@
1
1
  <% if (post.tags && post.tags.length) { %>
2
+ <% try { %>
3
+ <%# 在 _posts/ 外使用 tags 会报错 %>
2
4
  <%
3
5
  var items = [];
4
6
  var hidden_items = [];
@@ -9,4 +11,5 @@
9
11
  %>
10
12
  <%- items.join(' ') %>
11
13
  <span hidden itemprop="keywords"><%- hidden_items.join(' ') %></span>
14
+ <% }catch (error) {} %>
12
15
  <% } %>
@@ -1,4 +1,4 @@
1
- <% if (theme.comments.service == 'waline'){ %>
1
+ <% if (theme.comments.service == 'waline' && theme.comments.waline.comment && page.comments !== false){ %>
2
2
  <div class="new-meta-item comments-count">
3
3
  <%
4
4
  let commentPath;
@@ -3,9 +3,9 @@
3
3
  <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
4
4
  <meta itemprop="name" content="<%- config.title %>">
5
5
  </span>
6
- <span hidden itemprop="post" itemscope itemtype="http://schema.org/Post">
7
- <meta itemprop="name" content="<%- config.title %>">
8
- <meta itemprop="description" content="<%- config.description %>">
6
+ <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
7
+ <meta itemprop="name" content="<%- post.title || post.seo_title || config.title %>">
8
+ <meta itemprop="description" content="<%- post.description || config.description %>">
9
9
  </span>
10
10
  <%- partial('meta', {post: post, position: 'top'}) %>
11
11
  <div id="layoutHelper-page-plugins"></div>
@@ -179,6 +179,11 @@
179
179
  <% } %>
180
180
  </div>
181
181
  <% } %>
182
+ <!-- 文章推荐 -->
183
+ <% let footer_widget = theme.article.body.footer_widget; %>
184
+ <% if (footer_widget.recommended_article && footer_widget.recommended_article.enable == true && footer_widget.recommended_article.layout.includes(page.layout) && !page.skip_recommended_article) { %>
185
+ <%- 文章推荐生成器(post) %>
186
+ <% } %>
182
187
  <!-- Custom Files postEnd begin-->
183
188
  <%- volantis_inject('postEnd') %>
184
189
  <!-- Custom Files postEnd end-->
@@ -1,10 +1,10 @@
1
1
  <div id="l_cover">
2
2
  <% if (theme.plugins.pjax.enable) { %>
3
- <% if (theme.pjax_cover.enableCover) { %>
4
- <!-- see: /layout/_partial/scripts/_ctrl/coverCtrl.ejs -->
5
- <div id="<%- theme.pjax_cover.frontMatterCover %>" class='cover-wrapper <%- page.layout %> <%- theme.cover.layout_scheme %>' style="display: <%- theme.pjax_cover.coverWrapperDisplay %>;">
3
+ <% if (theme.cover_ctrl.enableCover) { %>
4
+ <!-- see: /layout/_partial/scripts/_ctrl.ejs -->
5
+ <div id="<%- theme.cover_ctrl.frontMatterCover %>" class='cover-wrapper <%- page.layout %> <%- theme.cover.layout_scheme %>' style="display: <%- theme.cover_ctrl.coverWrapperDisplay %>;">
6
6
  <%- partial("./_cover/layout") %>
7
- <div id="scroll-down" style="display: <%- theme.pjax_cover.scrollDownDisplay %>;"><i class="fa fa-chevron-down scroll-down-effects"></i></div>
7
+ <div id="scroll-down" style="display: <%- theme.cover_ctrl.scrollDownDisplay %>;"><i class="fa fa-chevron-down scroll-down-effects"></i></div>
8
8
  </div>
9
9
  <% } %>
10
10
  <% } else { %>
@@ -44,7 +44,7 @@
44
44
  <% } else if (item == 'info') { %>
45
45
  <%- __('footer.use') %>
46
46
  <a href="https://github.com/volantis-x/hexo-theme-volantis/#<%- theme_version %>" target="_blank" class="codename">Volantis</a>
47
- <%- __('footer.theme') %><% if (theme.analytics.busuanzi) { %><%- __('symbol.comma') %><%- __('footer.total_views') %>
47
+ <%- __('footer.theme') %><% if (theme.plugins.busuanzi.enable) { %><%- __('symbol.comma') %><%- __('footer.total_views') %>
48
48
  <span id="busuanzi_value_site_pv"><i class="fa-solid fa-loader fa-spin fa-fw" aria-hidden="true"></i></span>
49
49
  <%- __('footer.times') %>
50
50
  <% } %>
@@ -20,7 +20,7 @@
20
20
  <meta http-equiv="Content-Security-Policy" content="<%- theme.csp.content %>">
21
21
  <%_ } _%>
22
22
  <meta name="HandheldFriendly" content="True" >
23
- <meta name="apple-mobile-web-app-capable" content="yes">
23
+ <meta name="mobile-web-app-capable" content="yes">
24
24
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
25
25
  <meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
26
26
  <meta content="telephone=no" name="format-detection">
@@ -34,17 +34,10 @@
34
34
  <!-- Custom Files headBegin begin-->
35
35
  <%- volantis_inject('headBegin') %>
36
36
  <!-- Custom Files headBegin end-->
37
- <!-- front-matter head_begin begin -->
38
- <%_ if (page.import && page.import.head_begin){ _%>
39
- <%_ getList(page.import.head_begin).forEach(function(item){ _%>
40
- <%- item %>
41
- <%_ }) _%>
42
- <%_ } _%>
43
- <!-- front-matter head_begin end -->
44
37
  <%_ if (config.favicon) { _%>
45
38
  <link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
46
39
  <%_ } _%>
47
- <link rel="preload" href="<%- theme.cdn.map.css.style %>" as="style">
40
+ <link rel="preload" href="<%- theme.cdn.volantis_style %>" as="style">
48
41
  <%- generate_preload_fontfamily(theme) %>
49
42
  <!-- feed -->
50
43
  <%_ if (config.feed && config.feed.path){ _%>
@@ -61,8 +54,8 @@
61
54
  /* 首屏样式 */
62
55
  <%- FirstCSS() %>
63
56
  </style>
64
- <link rel="stylesheet" href="<%- theme.cdn.map.css.style %>" media="print" onload="this.media='all';this.onload=null">
65
- <noscript><link rel="stylesheet" href="<%- theme.cdn.map.css.style %>"></noscript>
57
+ <link rel="stylesheet" href="<%- theme.cdn.volantis_style %>" media="print" onload="this.media='all';this.onload=null">
58
+ <noscript><link rel="stylesheet" href="<%- theme.cdn.volantis_style %>"></noscript>
66
59
  <%_ if (theme.plugins.darkmode.enable) { _%>
67
60
  <script>
68
61
  let userColorScheme=localStorage.getItem("color-scheme")
@@ -73,6 +66,9 @@
73
66
  <%_ } _%>
74
67
  <%- partial('../_plugins/end-of-support/script') %>
75
68
  <%- partial('scripts/global') %>
69
+ <% if (theme.structured_data && theme.structured_data.enable) { %>
70
+ <%- structured_data() %>
71
+ <% } %>
76
72
  <!-- import head_end begin -->
77
73
  <%_ if (config.import && config.import.head_end){ _%>
78
74
  <%_ getList(config.import.head_end).forEach(function(item){ _%>
@@ -83,11 +79,4 @@
83
79
  <!-- Custom Files headEnd begin-->
84
80
  <%- volantis_inject('headEnd') %>
85
81
  <!-- Custom Files headEnd end-->
86
- <!-- front-matter head_end begin -->
87
- <%_ if (page.import && page.import.head_end){ _%>
88
- <%_ getList(page.import.head_end).forEach(function(item){ _%>
89
- <%- item %>
90
- <%_ }) _%>
91
- <%_ } _%>
92
- <!-- front-matter head_end end -->
93
82
  </head>
@@ -1,12 +1,12 @@
1
- <header itemscope itemtype="http://schema.org/WPHeader" id="l_header" class="l_header <%- theme.navbar.visiable %> <%- theme.custom_css.navbar.effect.join(' ') %> <%- theme.pjax_cover.headerShow %>" <%- (theme.navbar.visiable == 'auto' && theme.cover.height_scheme) ? "style='opacity: 0'" : "" %> >
1
+ <header itemscope itemtype="http://schema.org/WPHeader" id="l_header" class="l_header <%- theme.navbar.visiable %> <%- theme.custom_css.navbar.effect.join(' ') %> <%- theme.cover_ctrl.headerShow %>" <%- (theme.navbar.visiable == 'auto' && theme.cover.height_scheme) ? "style='opacity: 0'" : "" %> >
2
2
  <div class='container'>
3
3
  <div id='wrapper'>
4
4
  <div class='nav-sub'>
5
5
  <p class="title"></p>
6
6
  <ul class='switcher nav-list-h m-phone' id="pjax-header-nav-list">
7
- <li><a id="s-comment" class="fa-solid fa-comments fa-fw" target="_self" href="/" onclick="return false;" title="comment"></a></li>
7
+ <li><a id="s-comment" class="fa-solid fa-comments fa-fw" target="_self" title="comment"></a></li>
8
8
  <% if (page.sidebar == undefined || page.sidebar != false) { %>
9
- <li><a id="s-toc" class="s-toc fa-solid fa-list fa-fw" target="_self" href="/" onclick="return false;" title="toc"></a></li>
9
+ <li><a id="s-toc" class="s-toc fa-solid fa-list fa-fw" target="_self" title="toc"></a></li>
10
10
  <% } %>
11
11
  </ul>
12
12
  </div>
@@ -63,7 +63,7 @@
63
63
  <li>
64
64
  <a class="menuitem flat-box faa-parent animated-hover"
65
65
  <%- value.url ? `href="` + url_for(value.url) + `" title="` + (value.description || value.name) + `"`
66
- : ` href="/" onclick="return false;" title="` + (value.description || value.name) + `"` %>
66
+ : ` title="` + (value.description || value.name) + `"` %>
67
67
  <% if (value.rel) { %>
68
68
  rel="<%- value.rel %>"
69
69
  <% } %>
@@ -101,10 +101,10 @@
101
101
 
102
102
  <ul class='switcher nav-list-h m-phone'>
103
103
  <% if (theme.search.enable === true) { %>
104
- <li><a class="s-search fa-solid fa-search fa-fw" target="_self" href="/" onclick="return false;" title="search"></a></li>
104
+ <li><a class="s-search fa-solid fa-search fa-fw" target="_self" title="search"></a></li>
105
105
  <% } %>
106
106
  <li>
107
- <a class="s-menu fa-solid fa-bars fa-fw" target="_self" href="/" onclick="return false;" title="menu"></a>
107
+ <a class="s-menu fa-solid fa-bars fa-fw" target="_self" title="menu"></a>
108
108
  <ul class="menu-phone list-v navigation white-box">
109
109
  <% getList(menu_list).forEach(function(value){ %>
110
110
  <% menu(value, 'mobile') %>
@@ -3,9 +3,9 @@
3
3
  <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
4
4
  <meta itemprop="name" content="<%- config.title %>">
5
5
  </span>
6
- <span hidden itemprop="post" itemscope itemtype="http://schema.org/Post">
7
- <meta itemprop="name" content="<%- config.title %>">
8
- <meta itemprop="description" content="<%- config.description %>">
6
+ <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
7
+ <meta itemprop="name" content="<%- post.title || post.seo_title || config.title %>">
8
+ <meta itemprop="description" content="<%- post.description || config.description %>">
9
9
  </span>
10
10
  <%
11
11
  let showPin = false;
@@ -1,2 +1,43 @@
1
- <%- partial('_partial/scripts/_ctrl/cdnCtrl') _%>
2
- <%- partial('_partial/scripts/_ctrl/coverCtrl') _%>
1
+ <%_
2
+ // 为保证初次进入页面流畅,要求开启pjax且浏览器禁用Javascript时(仅HTML渲染)封面控制正常
3
+ // layout/_plugins/pjax/pdata.ejs
4
+ // layout/_partial/cover.ejs
5
+ // layout/_partial/header.ejs
6
+ theme.cover_ctrl={}
7
+ theme.cover_ctrl.enableCover = false; // 封面是否开启
8
+ theme.cover_ctrl.frontMatterCover = 'none'; // 封面控制
9
+ theme.cover_ctrl.coverWrapperDisplay = 'none';
10
+ theme.cover_ctrl.scrollDownDisplay = 'none';
11
+ theme.cover_ctrl.headerShow = 'show';
12
+ if(theme.cover && theme.cover.height_scheme) {
13
+ theme.cover_ctrl.enableCover = true;
14
+ }
15
+ if(theme.plugins.pjax.enable&&theme.plugins.pjax.cover) {
16
+ theme.cover_ctrl.enableCover = true;
17
+ }
18
+ if (theme.cover_ctrl.enableCover && page && page.cover) {
19
+ theme.cover_ctrl.frontMatterCover = page.cover;
20
+ if (is_home() && page.prev == 0 && theme.cover.height_scheme == 'full') {
21
+ theme.cover_ctrl.frontMatterCover = 'full';
22
+ } else {
23
+ theme.cover_ctrl.frontMatterCover = 'half';
24
+ }
25
+ }
26
+ /*cover*/
27
+ if (theme.cover_ctrl.frontMatterCover == "full") {
28
+ theme.cover_ctrl.coverWrapperDisplay= "";
29
+ theme.cover_ctrl.scrollDownDisplay = "";
30
+ } else if (theme.cover_ctrl.frontMatterCover == "half"){
31
+ theme.cover_ctrl.coverWrapperDisplay= "";
32
+ theme.cover_ctrl.scrollDownDisplay = "none";
33
+ } else if (theme.cover_ctrl.frontMatterCover == "none"){
34
+ theme.cover_ctrl.coverWrapperDisplay= "none";
35
+ theme.cover_ctrl.scrollDownDisplay = "none";
36
+ }
37
+ /*header*/
38
+ if (theme.cover_ctrl.frontMatterCover == "none") {
39
+ theme.cover_ctrl.headerShow="show";
40
+ } else {
41
+ theme.cover_ctrl.headerShow="";
42
+ }
43
+ _%>
@@ -0,0 +1,69 @@
1
+ <script>
2
+ volantis.GLOBAL_CONFIG ={
3
+ root: '<%- config.root %>',
4
+ debug: <%- JSON.stringify(theme.debug) %>,
5
+ default: <%- JSON.stringify(theme.default) %>,
6
+ lastupdate: new Date(<%- theme.getStartTime %>),
7
+ cdn: {
8
+ izitoast_css: '<%- theme.cdn.izitoast_css %>',
9
+ izitoast_js: '<%- theme.cdn.izitoast_js %>',
10
+ fancybox_css: '<%- theme.cdn.fancybox_css %>',
11
+ fancybox_js: '<%- theme.cdn.fancybox_js %>'
12
+ },
13
+ sidebar: {
14
+ for_page: <%- JSON.stringify(theme.sidebar.for_page) %>,
15
+ for_post: <%- JSON.stringify(theme.sidebar.for_post) %>,
16
+ webinfo: {
17
+ lastupd: {
18
+ enable: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.lastupd.enable) %>,
19
+ friendlyShow: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.lastupd.friendlyShow) %>
20
+ },
21
+ runtime: {
22
+ data: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.runtime.data) %>,
23
+ unit: <%- JSON.stringify(theme.sidebar.widget_library.webinfo.type.runtime.unit) %>
24
+ }
25
+ }
26
+ },
27
+ plugins: {
28
+ message: <%- JSON.stringify(theme.plugins.message) %>,
29
+ <% if(theme.plugins.aplayer.enable) { %>
30
+ aplayer: {
31
+ id: <%- JSON.stringify(theme.plugins.aplayer.id) %>,
32
+ enable:<%- JSON.stringify(theme.plugins.aplayer.enable) %>
33
+ },
34
+ <% } %>
35
+ <% if(theme.rightmenus.enable) { %>
36
+ rightmenus: <%- JSON.stringify(theme.rightmenus) %>
37
+ <% } %>
38
+ },
39
+ search: {
40
+ <% if(theme.search.service === 'algolia') { %>
41
+ appId: '<%- env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID %>',
42
+ indexName: '<%- env.ALGOLIA_APP_ID || config.algolia.indexName %>',
43
+ apiKey: '<%- env.ALGOLIA_API_KEY || config.algolia.apiKey %>',
44
+ hitsPerPage: '<%- theme.search.algolia.hitsPerPage %>',
45
+ placeholder: '<%- theme.search.algolia.placeholder %>',
46
+ searchAsYouType: <%- theme.search.algolia.searchAsYouType %>,
47
+ <% } %>
48
+
49
+ <% if(theme.search.service === 'hexo') { %>
50
+ dataPath: (("<%- config.root %>" || "/").endsWith("/") ? "<%- config.root %>" || "/" : "<%- config.root %>/" || "/") + "<%- config?.jsonContent?.file || "content.json" %>",
51
+ <% } %>
52
+
53
+ <% if(theme.search.service === 'meilisearch') { %>
54
+ placeholder: '<%- theme.search.meilisearch.placeholder %>',
55
+ apiKey: '<%- theme.search.meilisearch.searchKey %>',
56
+ indexName: '<%- theme.search.meilisearch.indexName %>',
57
+ appId: '<%- theme.search.meilisearch.hostUrl %>',
58
+ <% } %>
59
+ },
60
+ languages: {
61
+ <% if(theme.search.enable) { %>
62
+ search: {
63
+ hits_empty: "<%- __('search.hits_empty') %>",
64
+ hits_stats: "<%- __('search.hits_stats') %>",
65
+ }
66
+ <% } %>
67
+ }
68
+ }
69
+ </script>