hexo-theme-fluid 1.8.13 → 1.9.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.
Files changed (155) hide show
  1. package/LICENSE +674 -21
  2. package/README.md +17 -21
  3. package/_config.yml +164 -79
  4. package/languages/de.yml +58 -33
  5. package/languages/en.yml +58 -33
  6. package/languages/eo.yml +58 -33
  7. package/languages/es.yml +69 -0
  8. package/languages/ja.yml +58 -33
  9. package/languages/zh-CN.yml +58 -33
  10. package/languages/zh-HK.yml +69 -0
  11. package/languages/zh-TW.yml +58 -33
  12. package/layout/.DS_Store +0 -0
  13. package/layout/404.ejs +3 -1
  14. package/layout/{_partial → _partials}/archive-list.ejs +4 -4
  15. package/layout/_partials/category-chains.ejs +19 -0
  16. package/layout/_partials/category-list.ejs +62 -0
  17. package/layout/{_partial → _partials}/comments/changyan.ejs +0 -0
  18. package/layout/{_partial → _partials}/comments/cusdis.ejs +0 -0
  19. package/layout/{_partial → _partials}/comments/disqus.ejs +0 -0
  20. package/layout/_partials/comments/giscus.ejs +36 -0
  21. package/layout/{_partial → _partials}/comments/gitalk.ejs +0 -0
  22. package/layout/{_partial → _partials}/comments/livere.ejs +0 -0
  23. package/layout/{_partial → _partials}/comments/remark42.ejs +0 -0
  24. package/layout/{_partial → _partials}/comments/twikoo.ejs +3 -1
  25. package/layout/{_partial → _partials}/comments/utterances.ejs +1 -1
  26. package/layout/{_partial → _partials}/comments/valine.ejs +3 -1
  27. package/layout/{_partial → _partials}/comments/waline.ejs +6 -3
  28. package/layout/_partials/comments.ejs +5 -0
  29. package/layout/_partials/css.ejs +26 -0
  30. package/layout/_partials/footer/beian.ejs +33 -0
  31. package/layout/_partials/footer/statistics.ejs +39 -0
  32. package/layout/_partials/footer.ejs +18 -0
  33. package/layout/{_partial → _partials}/head.ejs +7 -1
  34. package/layout/_partials/header/banner.ejs +33 -0
  35. package/layout/{_partial/nav.ejs → _partials/header/navigation.ejs} +3 -2
  36. package/layout/_partials/header.ejs +8 -0
  37. package/layout/{_partial → _partials}/paginator.ejs +0 -0
  38. package/layout/_partials/plugins/analytics.ejs +87 -0
  39. package/layout/_partials/plugins/anchorjs.ejs +24 -0
  40. package/layout/_partials/plugins/code-widget.ejs +71 -0
  41. package/layout/_partials/plugins/fancybox.ejs +11 -0
  42. package/layout/_partials/plugins/highlight.ejs +13 -0
  43. package/layout/_partials/plugins/math.ejs +46 -0
  44. package/layout/_partials/plugins/mermaid.ejs +5 -0
  45. package/layout/{_partial → _partials}/plugins/nprogress.ejs +0 -0
  46. package/layout/_partials/plugins/typed.ejs +48 -0
  47. package/layout/_partials/post/category-bar.ejs +18 -0
  48. package/layout/_partials/post/copyright.ejs +56 -0
  49. package/layout/_partials/post/meta-bottom.ejs +16 -0
  50. package/layout/_partials/post/meta-top.ejs +63 -0
  51. package/layout/_partials/post/sidebar-left.ejs +10 -0
  52. package/layout/_partials/post/sidebar-right.ejs +10 -0
  53. package/layout/_partials/post/toc.ejs +34 -0
  54. package/layout/_partials/scripts.ejs +32 -0
  55. package/layout/{_partial → _partials}/search.ejs +2 -3
  56. package/layout/about.ejs +5 -3
  57. package/layout/archive.ejs +1 -1
  58. package/layout/categories.ejs +10 -59
  59. package/layout/category.ejs +1 -1
  60. package/layout/index.ejs +13 -15
  61. package/layout/layout.ejs +19 -39
  62. package/layout/links.ejs +2 -8
  63. package/layout/page.ejs +28 -12
  64. package/layout/post.ejs +65 -59
  65. package/layout/tag.ejs +1 -1
  66. package/package.json +11 -3
  67. package/scripts/.DS_Store +0 -0
  68. package/scripts/events/.DS_Store +0 -0
  69. package/scripts/events/index.js +1 -0
  70. package/scripts/events/lib/compatible-configs.js +7 -8
  71. package/scripts/events/lib/footnote.js +1 -1
  72. package/scripts/events/lib/hello.js +6 -2
  73. package/scripts/events/lib/highlight.js +93 -24
  74. package/scripts/events/lib/injects.js +118 -0
  75. package/scripts/events/lib/merge-configs.js +37 -7
  76. package/scripts/filters/default-injects.js +27 -0
  77. package/scripts/filters/post-filter.js +7 -0
  78. package/scripts/helpers/date.js +25 -0
  79. package/scripts/helpers/engine.js +9 -0
  80. package/scripts/helpers/export-config.js +8 -0
  81. package/scripts/helpers/import.js +24 -0
  82. package/scripts/helpers/injects.js +7 -0
  83. package/scripts/helpers/scope.js +44 -0
  84. package/scripts/helpers/utils.js +17 -2
  85. package/scripts/tags/checkbox.js +4 -2
  86. package/scripts/utils/.DS_Store +0 -0
  87. package/scripts/utils/object.js +5 -0
  88. package/scripts/utils/resolve.js +15 -0
  89. package/source/.DS_Store +0 -0
  90. package/source/css/_pages/_archive/archive.styl +28 -0
  91. package/source/css/_pages/_base/_widget/anchorjs.styl +8 -0
  92. package/source/css/_pages/_base/_widget/banner.styl +2 -11
  93. package/source/css/_pages/_base/_widget/board.styl +1 -4
  94. package/source/css/_pages/_base/_widget/code-widget.styl +36 -0
  95. package/source/css/_pages/_base/_widget/copyright.styl +90 -0
  96. package/source/css/_pages/_base/_widget/footer.styl +4 -1
  97. package/source/css/_pages/_base/_widget/header.styl +161 -2
  98. package/source/css/_pages/_base/_widget/modal.styl +100 -0
  99. package/source/css/_pages/_base/_widget/ngrogress.styl +12 -0
  100. package/source/css/_pages/_base/_widget/noscript.styl +12 -0
  101. package/source/css/_pages/_base/_widget/pagination.styl +23 -0
  102. package/source/css/_pages/_base/_widget/scroll-btn.styl +2 -15
  103. package/source/css/_pages/_base/_widget/toc.styl +75 -0
  104. package/source/css/_pages/_base/base.styl +23 -3
  105. package/source/css/_pages/_base/color-schema.styl +30 -58
  106. package/source/css/_pages/_base/inline.styl +2 -2
  107. package/source/css/_pages/_category/category-bar.styl +59 -0
  108. package/source/css/_pages/_category/category-chain.styl +6 -0
  109. package/source/css/_pages/_category/{categories.styl → category-list.styl} +17 -11
  110. package/source/css/_pages/_index/index.styl +7 -5
  111. package/source/css/_pages/_links/links.styl +2 -1
  112. package/source/css/_pages/_post/comment.styl +27 -0
  113. package/source/css/_pages/_post/highlight.styl +65 -0
  114. package/source/css/_pages/_post/markdown.styl +91 -0
  115. package/source/css/_pages/_post/{post.styl → post-page.styl} +44 -75
  116. package/source/css/_pages/_post/{tag_plugin.styl → post-tag.styl} +29 -27
  117. package/source/css/_variables/base.styl +30 -9
  118. package/source/css/highlight-dark.styl +6 -0
  119. package/source/css/highlight.styl +6 -0
  120. package/source/css/main.styl +7 -0
  121. package/source/img/.DS_Store +0 -0
  122. package/source/img/default.png +0 -0
  123. package/source/img/{favicon.png → fluid.png} +0 -0
  124. package/source/js/boot.js +1 -9
  125. package/source/js/color-schema.js +52 -7
  126. package/source/js/events.js +15 -15
  127. package/source/js/leancloud.js +9 -2
  128. package/source/js/local-search.js +2 -2
  129. package/source/js/plugins.js +26 -94
  130. package/source/js/utils.js +28 -12
  131. package/.editorconfig +0 -13
  132. package/.eslintrc +0 -224
  133. package/.gitattributes +0 -1
  134. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
  135. package/.github/ISSUE_TEMPLATE/bug_report_zh.md +0 -33
  136. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  137. package/.github/ISSUE_TEMPLATE/feature_request_zh.md +0 -20
  138. package/.github/ISSUE_TEMPLATE/question.md +0 -11
  139. package/.github/ISSUE_TEMPLATE/question_zh.md +0 -14
  140. package/.github/workflows/limit.yaml +0 -18
  141. package/README_en.md +0 -125
  142. package/layout/_partial/beian.ejs +0 -36
  143. package/layout/_partial/css.ejs +0 -47
  144. package/layout/_partial/footer.ejs +0 -11
  145. package/layout/_partial/plugins/analytics.ejs +0 -66
  146. package/layout/_partial/plugins/math.ejs +0 -69
  147. package/layout/_partial/plugins/mermaid.ejs +0 -24
  148. package/layout/_partial/plugins/typed.ejs +0 -41
  149. package/layout/_partial/post-meta.ejs +0 -51
  150. package/layout/_partial/scripts.ejs +0 -72
  151. package/layout/_partial/statistics.ejs +0 -43
  152. package/layout/_partial/toc.ejs +0 -4
  153. package/source/css/_pages/_base/_widget/copy-btn.styl +0 -42
  154. package/source/css/_pages/_base/rewrite.styl +0 -556
  155. package/source/css/_pages/_category/category.styl +0 -0
@@ -0,0 +1,19 @@
1
+ <% function render_category_chain(cat) { %>
2
+ <a href="<%= url_for(cat.path) %>" class="category-chain-item"><%= cat.name.trim() %></a>
3
+ <% var nextCats = categories.find({ parent: cat._id }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
4
+ <% if (nextCats.length > 0) { %>
5
+ <span>></span>
6
+ <%- render_category_chain(nextCats.data[0]) %>
7
+ <% } %>
8
+ <% } %>
9
+
10
+ <span class="category-chains">
11
+ <% var catsFirst = categories.find({ parent: { $exists: false } }).sort(config.index_generator.order_by || 'name').filter(cat => cat.length) %>
12
+ <% catsFirst.each((cat, idx) => { %>
13
+ <% if (typeof(limit) === "undefined" || idx < limit) { %>
14
+ <span class="category-chain">
15
+ <%- render_category_chain(cat) %>
16
+ </span>
17
+ <% } %>
18
+ <% }) %>
19
+ </span>
@@ -0,0 +1,62 @@
1
+ <% function render_categories(curCats, params = {}, depth = 0) { %>
2
+ <% return curCats.each((cat) => { %>
3
+ <% var subCats = site.categories.find({ parent: cat._id }).sort(params.orderBy || 'name').filter(cat => cat.length) %>
4
+ <% var collapsed = subCats.length === 0 || depth >= theme.category.collapse_depth %>
5
+ <% if ((params.activeIds || []).includes(cat._id)) collapsed = false %>
6
+ <div class="<%= depth <= 0 ? 'category' : 'category-sub' %> row nomargin-x">
7
+ <a class="<%= depth <= 0 ? 'category-item' : 'category-subitem' %> <%= collapsed ? 'collapsed' : '' %>
8
+ list-group-item category-item-action col-10 col-md-11 col-xm-11" title="<%= cat.name.trim() %>"
9
+ id="heading-<%= md5(cat.name) %>" role="tab" data-toggle="collapse" href="#collapse-<%= md5(cat.name) %>"
10
+ aria-expanded="<%= collapsed ? 'false' : 'true' %>"
11
+ >
12
+ <%= cat.name.trim() %>
13
+ <span class="list-group-count"><%= params.type === 'post' ? `(${ cat.posts.length })` : '' %></span>
14
+ <i class="iconfont icon-arrowright"></i>
15
+ </a>
16
+ <% if(params.type !== 'post') { %>
17
+ <a href="<%= url_for(cat.path) %>" class="category-count col-2 col-md-1 col-xm-1">
18
+ <i class="iconfont icon-articles"></i>
19
+ <span><%= cat.posts.length %></span>
20
+ </a>
21
+ <% } %>
22
+ <div class="category-collapse collapse <%= collapsed ? '' : 'show' %>" id="collapse-<%= md5(cat.name) %>"
23
+ role="tabpanel" aria-labelledby="heading-<%= md5(cat.name) %>">
24
+ <% var posts = cat.posts.sort(params.postOrderBy || '-date') %>
25
+ <% if (subCats.length > 0) { %>
26
+ <% var filteredPosts = posts.filter((p) => {
27
+ return p.categories.filter(catOnPost => catOnPost.parent === cat._id).length === 0;
28
+ }) %>
29
+ <%- render_posts(filteredPosts, cat, params) %>
30
+ <%- render_categories(subCats, params, depth + 1) %>
31
+ <% } else { %>
32
+ <%- render_posts(posts, cat, params) %>
33
+ <% } %>
34
+ </div>
35
+ </div>
36
+ <% }) %>
37
+ <% } %>
38
+
39
+ <% function render_posts(posts, cat, params) { %>
40
+ <div class="category-post-list">
41
+ <% var limit = params.postLimit %>
42
+ <% for (var idx = 0; idx < posts.length; idx++) { %>
43
+ <% var post = posts.data[idx] %>
44
+ <% if (idx && limit && idx >= limit) { %>
45
+ <a href="<%= url_for(cat.path) %>" class="list-group-item list-group-item-action">
46
+ <span class="category-post"><%- __('category.more') %></span>
47
+ </a>
48
+ <% break %>
49
+ <% } else { %>
50
+ <a href="<%= url_for(post.path) %>" title="<%= post.title %>"
51
+ class="list-group-item list-group-item-action
52
+ <%= (params.activeIds || []).includes(post._id) ? 'active' : '' %>">
53
+ <span class="category-post"><%= post.title %></span>
54
+ </a>
55
+ <% } %>
56
+ <% } %>
57
+ </div>
58
+ <% } %>
59
+
60
+ <div class="category-list">
61
+ <%- render_categories(curCats, params) %>
62
+ </div>
@@ -0,0 +1,36 @@
1
+ <% if (theme.giscus && theme.giscus['repo'] && theme.giscus['repo-id']) { %>
2
+ <div id="giscus" class="giscus"></div>
3
+ <script type="text/javascript">
4
+ Fluid.utils.loadComments('#giscus', function() {
5
+ var options = <%- JSON.stringify(theme.giscus || {}) %>;
6
+ var attributes = {};
7
+ for (let option in options) {
8
+ if (!option.startsWith('theme-')) {
9
+ var key = option.startsWith('data-') ? option : 'data-' + option;
10
+ attributes[key] = options[option];
11
+ }
12
+ }
13
+ var light = '<%= theme.giscus['theme-light'] || 'light' %>';
14
+ var dark = '<%= theme.giscus['theme-dark'] || 'dark' %>';
15
+ window.GiscusThemeLight = light;
16
+ window.GiscusThemeDark = dark;
17
+ attributes['data-theme'] = document.documentElement.getAttribute('data-user-color-scheme') === 'dark' ? dark : light;
18
+ for (let attribute in attributes) {
19
+ var value = attributes[attribute];
20
+ if (value === undefined || value === null || value === '') {
21
+ delete attributes[attribute];
22
+ }
23
+ }
24
+ var s = document.createElement('script');
25
+ s.setAttribute('src', 'https://giscus.app/client.js');
26
+ s.setAttribute('crossorigin', 'anonymous');
27
+ for (let attribute in attributes) {
28
+ s.setAttribute(attribute, attributes[attribute]);
29
+ }
30
+ var ss = document.getElementsByTagName('script');
31
+ var e = ss.length > 0 ? ss[ss.length - 1] : document.head || document.documentElement;
32
+ e.parentNode.insertBefore(s, e.nextSibling);
33
+ });
34
+ </script>
35
+ <noscript>Please enable JavaScript to view the comments</noscript>
36
+ <% } %>
@@ -9,7 +9,9 @@
9
9
  el: '#twikoo',
10
10
  path: '<%= theme.twikoo.path %>',
11
11
  onCommentLoaded: function() {
12
- Fluid.plugins.initFancyBox('#twikoo .tk-content img:not(.tk-owo-emotion)');
12
+ var imgSelector = '#twikoo .tk-content img:not(.tk-owo-emotion)';
13
+ Fluid.plugins.imageCaption(imgSelector);
14
+ Fluid.plugins.fancyBox(imgSelector);
13
15
  }
14
16
  }
15
17
  )
@@ -19,7 +19,7 @@
19
19
  s.setAttribute('label', '<%= theme.utterances.label %>');
20
20
  <% } %>
21
21
  s.setAttribute('theme', schema);
22
- s.setAttribute('crossorigin', '<%= theme.utterances.crossorigin %>');
22
+ s.setAttribute('crossorigin', 'anonymous');
23
23
  document.getElementById('comments').appendChild(s);
24
24
  })
25
25
  </script>
@@ -12,7 +12,9 @@
12
12
  )
13
13
  new Valine(options);
14
14
  Fluid.utils.waitElementVisible('#valine .vcontent', () => {
15
- Fluid.plugins.initFancyBox('#valine .vcontent img:not(.vemoji)');
15
+ var imgSelector = '#valine .vcontent img:not(.vemoji)';
16
+ Fluid.plugins.imageCaption(imgSelector);
17
+ Fluid.plugins.fancyBox(imgSelector);
16
18
  })
17
19
  });
18
20
  });
@@ -2,7 +2,8 @@
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() {
5
+ Fluid.utils.createCssLink('<%= url_join(theme.static_prefix.waline, 'waline.min.css') %>')
6
+ Fluid.utils.createScript('<%= url_join(theme.static_prefix.waline, 'waline.min.js') %>', function() {
6
7
  var options = Object.assign(
7
8
  <%- JSON.stringify(theme.waline || {}) %>,
8
9
  {
@@ -10,9 +11,11 @@
10
11
  path: <%= theme.waline.path %>
11
12
  }
12
13
  )
13
- new Waline(options);
14
+ Waline.init(options);
14
15
  Fluid.utils.waitElementVisible('#waline .vcontent', () => {
15
- Fluid.plugins.initFancyBox('#waline .vcontent img:not(.vemoji)');
16
+ var imgSelector = '#waline .vcontent img:not(.vemoji)';
17
+ Fluid.plugins.imageCaption(imgSelector);
18
+ Fluid.plugins.fancyBox(imgSelector);
16
19
  })
17
20
  });
18
21
  });
@@ -0,0 +1,5 @@
1
+ <% if ((!is_post() && !is_page()) || (is_post() && theme.post.comments.enable && page.comments) || (is_page() && page.comments)) { %>
2
+ <article id="comments">
3
+ <%- partial('_partials/comments/' + (typeof page.comment === 'string' && page.comment !== '' ? page.comment : theme.post.comments.type)) %>
4
+ </article>
5
+ <% } %>
@@ -0,0 +1,26 @@
1
+ <%- css_ex(theme.static_prefix.bootstrap, 'css/bootstrap.min.css') %>
2
+
3
+ <% var css_snippets = deduplicate(page.css_snippets) %>
4
+ <% for (var idx = 0; idx < css_snippets.length; idx++) { %>
5
+ <%- css_snippets[idx] %>
6
+ <% } %>
7
+ <% page.css_snippets = [] %>
8
+
9
+ <!-- 主题依赖的图标库,不要自行修改 -->
10
+ <!-- Do not modify the link that theme dependent icons -->
11
+ <%- css('//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css') %>
12
+
13
+ <%- css(theme.static_prefix.iconfont || theme.iconfont) %>
14
+
15
+ <%- css_ex(theme.static_prefix.internal_css, 'main.css') %>
16
+
17
+ <% if (theme.code.highlight.enable) { %>
18
+ <%- css_ex(theme.static_prefix.internal_css, 'highlight.css', 'id="highlight-css"') %>
19
+ <% if (theme.dark_mode.enable) { %>
20
+ <%- css_ex(theme.static_prefix.internal_css, 'highlight-dark.css', 'id="highlight-css-dark"') %>
21
+ <% } %>
22
+ <% } %>
23
+
24
+ <% if (theme.custom_css) { %>
25
+ <%- css(theme.custom_css) %>
26
+ <% } %>
@@ -0,0 +1,33 @@
1
+ <div class="beian">
2
+ <span>
3
+ <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
4
+ <%- theme.footer.beian.icp_text %>
5
+ </a>
6
+ </span>
7
+ <% if(theme.footer.beian.police_text) { %>
8
+ <% if(theme.footer.beian.police_code) { %>
9
+ <span>
10
+ <a
11
+ href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%= theme.footer.beian.police_code %>"
12
+ rel="nofollow noopener"
13
+ class="beian-police"
14
+ target="_blank"
15
+ >
16
+ <% if(theme.footer.beian.police_icon) { %>
17
+ <span style="visibility: hidden; width: 0">|</span>
18
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
19
+ <% } %>
20
+ <span><%- theme.footer.beian.police_text %></span>
21
+ </a>
22
+ </span>
23
+ <% } else { %>
24
+ <span class="beian-police">
25
+ <% if(theme.footer.beian.police_icon) { %>
26
+ <span style="visibility: hidden; width: 0">|</span>
27
+ <img src="<%= url_for(theme.footer.beian.police_icon) %>" alt="police-icon"/>
28
+ <% } %>
29
+ <span class="beian-police"><%- theme.footer.beian.police_text %></span>
30
+ </span>
31
+ <% } %>
32
+ <% } %>
33
+ </div>
@@ -0,0 +1,39 @@
1
+ <div class="statistics">
2
+ <% var pv_texts = (theme.footer.statistics.pv_format || __('footer.pv')).split('{}') %>
3
+ <% var uv_texts = (theme.footer.statistics.uv_format || __('footer.uv')).split('{}') %>
4
+
5
+ <% if (theme.footer.statistics.source === 'leancloud') { %>
6
+ <% if (pv_texts.length >= 2) { %>
7
+ <span id="leancloud-site-pv-container" style="display: none">
8
+ <%- pv_texts[0] %>
9
+ <span id="leancloud-site-pv"></span>
10
+ <%- pv_texts[1] %>
11
+ </span>
12
+ <% } %>
13
+ <% if (uv_texts.length >= 2) { %>
14
+ <span id="leancloud-site-uv-container" style="display: none">
15
+ <%- uv_texts[0] %>
16
+ <span id="leancloud-site-uv"></span>
17
+ <%- uv_texts[1] %>
18
+ </span>
19
+ <% } %>
20
+ <% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
21
+
22
+ <% } else if (theme.footer.statistics.source === 'busuanzi') { %>
23
+ <% if (pv_texts.length >= 2) { %>
24
+ <span id="busuanzi_container_site_pv" style="display: none">
25
+ <%- pv_texts[0] %>
26
+ <span id="busuanzi_value_site_pv"></span>
27
+ <%- pv_texts[1] %>
28
+ </span>
29
+ <% } %>
30
+ <% if (uv_texts.length >= 2) { %>
31
+ <span id="busuanzi_container_site_uv" style="display: none">
32
+ <%- uv_texts[0] %>
33
+ <span id="busuanzi_value_site_uv"></span>
34
+ <%- uv_texts[1] %>
35
+ </span>
36
+ <% } %>
37
+ <% import_js(theme.static_prefix.busuanzi, 'busuanzi.pure.mini.js', 'defer') %>
38
+ <% } %>
39
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="footer-inner">
2
+ <% if (theme.footer.content) { %>
3
+ <div class="footer-content">
4
+ <%- theme.footer.content %>
5
+ </div>
6
+ <% } %>
7
+ <% if (theme.footer.statistics.enable) { %>
8
+ <%- partial('_partials/footer/statistics.ejs') %>
9
+ <% } %>
10
+ <% if(theme.footer.beian.enable) { %>
11
+ <!-- 备案信息 ICP for China -->
12
+ <%- partial('_partials/footer/beian.ejs') %>
13
+ <% } %>
14
+ <% if(theme.web_analytics.cnzz) { %>
15
+ <!-- cnzz Analytics Icon -->
16
+ <span id="cnzz_stat_icon_<%= theme.web_analytics.cnzz %>" style="display: none"></span>
17
+ <% } %>
18
+ </div>
@@ -30,13 +30,19 @@ var ogConfig = Object.assign({ image: ogImage && url_for(ogImage) }, theme.open_
30
30
  <% } else { %>
31
31
  <meta name="description" content="<%= description %>">
32
32
  <% } %>
33
+ <% if ((theme.post.meta.views.enable && theme.post.meta.views.source === 'busuanzi')
34
+ || (theme.footer.statistics.enable && theme.footer.statistics.source === 'busuanzi')) { %>
35
+ <meta name="referrer" content="no-referrer-when-downgrade">
36
+ <% } %>
33
37
  <% if (theme.custom_head) { %>
34
38
  <%- theme.custom_head %>
35
39
  <% } %>
36
40
  <title><%= title %></title>
37
41
 
38
- <%- partial('_partial/css.ejs') %>
42
+ <%- partial('_partials/css.ejs') %>
39
43
  <%- export_config() %>
40
44
  <%- js_ex(theme.static_prefix.internal_js, 'utils.js') %>
41
45
  <%- js_ex(theme.static_prefix.internal_js, 'color-schema.js') %>
46
+
47
+ <%- inject_point('head') %>
42
48
  </head>
@@ -0,0 +1,33 @@
1
+ <%
2
+ var banner_img = page.banner_img || theme.index.banner_img
3
+ var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
4
+ var banner_mask_alpha = parseFloat(page.banner_mask_alpha || theme.index.banner_mask_alpha)
5
+ var subtitle = page.subtitle || page.title
6
+ %>
7
+
8
+ <div id="banner" class="banner" <%- theme.banner && theme.banner.parallax && 'parallax=true' %>
9
+ style="background: url('<%- url_for(banner_img) %>') no-repeat center center; background-size: cover;">
10
+ <div class="full-bg-img">
11
+ <div class="mask flex-center" style="background-color: rgba(0, 0, 0, <%= parseFloat(banner_mask_alpha) %>)">
12
+ <div class="banner-text text-center fade-in-up">
13
+ <div class="h2">
14
+ <% if(theme.fun_features.typing.enable && in_scope(theme.fun_features.typing.scope)) { %>
15
+ <span id="subtitle" data-typed-text="<%= subtitle %>"></span>
16
+ <% } else { %>
17
+ <span id="subtitle"><%- subtitle %></span>
18
+ <% } %>
19
+ </div>
20
+
21
+ <% if (is_post()) { %>
22
+ <%- inject_point('postMetaTop') %>
23
+ <% } %>
24
+ </div>
25
+
26
+ <% if (theme.scroll_down_arrow.enable && theme.scroll_down_arrow.banner_height_limit <= banner_img_height && page.layout !== '404') { %>
27
+ <div class="scroll-down-bar">
28
+ <i class="iconfont icon-arrowdown"></i>
29
+ </div>
30
+ <% } %>
31
+ </div>
32
+ </div>
33
+ </div>
@@ -15,8 +15,8 @@
15
15
  <ul class="navbar-nav ml-auto text-center">
16
16
  <% for(const each of theme.navbar.menu || []) { %>
17
17
  <% if (!each.submenu && !each.link) continue %>
18
- <% var text = each.name || __(each.key + '.title') %>
19
- <% if (text.indexOf('.title') !== -1) {
18
+ <% var text = each.name || __(each.key + '.menu') || __(each.key + '.title') %>
19
+ <% if (text.indexOf('.menu') !== -1 || text.indexOf('.title') !== -1) {
20
20
  text = each.key
21
21
  } %>
22
22
  <% if (each.submenu) { %>
@@ -55,6 +55,7 @@
55
55
  &nbsp;<i class="iconfont icon-search"></i>&nbsp;
56
56
  </a>
57
57
  </li>
58
+ <% import_js(theme.static_prefix.internal_js, 'local-search.js') %>
58
59
  <% } %>
59
60
  <% if(theme.dark_mode && theme.dark_mode.enable) { %>
60
61
  <li class="nav-item" id="color-toggle-btn">
@@ -0,0 +1,8 @@
1
+ <%
2
+ var banner_img_height = parseFloat(page.banner_img_height || theme.index.banner_img_height)
3
+ %>
4
+
5
+ <div class="header-inner" style="height: <%= banner_img_height %>vh;">
6
+ <%- partial('_partials/header/navigation') %>
7
+ <%- partial('_partials/header/banner') %>
8
+ </div>
File without changes
@@ -0,0 +1,87 @@
1
+ <% if (theme.web_analytics.enable) { %>
2
+
3
+ <% if(theme.web_analytics.baidu) { %>
4
+ <!-- Baidu Analytics -->
5
+ <script defer>
6
+ if (!Fluid.ctx.dnt) {
7
+ var _hmt = _hmt || [];
8
+ (function() {
9
+ var hm = document.createElement("script");
10
+ hm.src = "https://hm.baidu.com/hm.js?<%= theme.web_analytics.baidu %>";
11
+ var s = document.getElementsByTagName("script")[0];
12
+ s.parentNode.insertBefore(hm, s);
13
+ })();
14
+ }
15
+ </script>
16
+ <% } %>
17
+
18
+ <% if (theme.web_analytics.google){ %>
19
+ <!-- Google Analytics -->
20
+ <script defer>
21
+ if (!Fluid.ctx.dnt) {
22
+ Fluid.utils.createScript('https://www.google-analytics.com/analytics.js', function() {
23
+ window.ga = window.ga || function() { (ga.q = ga.q || []).push(arguments) };
24
+ ga.l = +new Date;
25
+ ga('create', '<%= theme.web_analytics.google %>', 'auto');
26
+ ga('send', 'pageview');
27
+ });
28
+ }
29
+ </script>
30
+ <% } %>
31
+
32
+ <% if (theme.web_analytics.gtag){ %>
33
+ <!-- Google gtag.js -->
34
+ <script defer>
35
+ if (!Fluid.ctx.dnt) {
36
+ Fluid.utils.createScript('https://www.googletagmanager.com/gtag/js?id=<%= theme.web_analytics.gtag %>', function() {
37
+ window.dataLayer = window.dataLayer || [];
38
+ function gtag(){dataLayer.push(arguments);}
39
+ gtag('js', new Date());
40
+ gtag('config', '<%- theme.web_analytics.gtag %>');
41
+ });
42
+ }
43
+ </script>
44
+ <% } %>
45
+
46
+ <% if(theme.web_analytics.tencent && theme.web_analytics.tencent.sid && theme.web_analytics.tencent.cid) { %>
47
+ <!-- Tencent Analytics -->
48
+ <script defer>
49
+ if (!Fluid.ctx.dnt) {
50
+ var _mtac = {};
51
+ (function() {
52
+ var mta = document.createElement("script");
53
+ mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
54
+ mta.setAttribute("name", "MTAH5");
55
+ mta.setAttribute("sid", "<%= theme.web_analytics.tencent.sid %>");
56
+ <% if(theme.web_analytics.tencent.cid) { %>
57
+ mta.setAttribute("cid", "<%= theme.web_analytics.tencent.cid %>");
58
+ <% } %>
59
+ var s = document.getElementsByTagName("script")[0];
60
+ s.parentNode.insertBefore(mta, s);
61
+ })();
62
+ }
63
+ </script>
64
+ <% } %>
65
+
66
+ <% if(theme.web_analytics.woyaola) { %>
67
+ <!-- 51.la Analytics -->
68
+ <script defer>
69
+ if (!Fluid.ctx.dnt) {
70
+ Fluid.utils.createScript('//js.users.51.la/<%= theme.web_analytics.woyaola %>.js');
71
+ }
72
+ </script>
73
+ <% } %>
74
+
75
+ <% if(theme.web_analytics.cnzz) { %>
76
+ <!-- cnzz Analytics -->
77
+ <script defer>
78
+ if (!Fluid.ctx.dnt) {
79
+ Fluid.utils.createScript('//s4.cnzz.com/z_stat.php?id=<%= theme.web_analytics.cnzz %>&show=pic');
80
+ }
81
+ </script>
82
+ <% } %>
83
+
84
+ <% if(theme.web_analytics.leancloud && theme.web_analytics.leancloud.app_id && theme.web_analytics.leancloud.app_key) { %>
85
+ <% import_js(theme.static_prefix.internal_js, 'leancloud.js', 'defer') %>
86
+ <% } %>
87
+ <% } %>
@@ -0,0 +1,24 @@
1
+ <%
2
+ import_script(`
3
+ <script>
4
+ Fluid.utils.createScript('${ url_join(theme.static_prefix.anchor, 'anchor.min.js') }', function() {
5
+ window.anchors.options = {
6
+ placement: CONFIG.anchorjs.placement,
7
+ visible : CONFIG.anchorjs.visible
8
+ };
9
+ if (CONFIG.anchorjs.icon) {
10
+ window.anchors.options.icon = CONFIG.anchorjs.icon;
11
+ }
12
+ var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
13
+ var res = [];
14
+ for (var item of el) {
15
+ res.push('.markdown-body > ' + item.trim());
16
+ }
17
+ if (CONFIG.anchorjs.placement === 'left') {
18
+ window.anchors.options.class = 'anchorjs-link-left';
19
+ }
20
+ window.anchors.add(res.join(', '));
21
+ });
22
+ </script>
23
+ `)
24
+ %>
@@ -0,0 +1,71 @@
1
+ <%
2
+ import_script(`<script>
3
+ (function() {
4
+ var enableLang = CONFIG.code_language.enable && CONFIG.code_language.default;
5
+ var enableCopy = CONFIG.copy_btn;
6
+ if (!enableLang && !enableCopy) {
7
+ return;
8
+ }
9
+
10
+ function getBgClass(ele) {
11
+ return Fluid.utils.getBackgroundLightness(ele) >= 0 ? 'code-widget-light' : 'code-widget-dark';
12
+ }
13
+
14
+ var copyTmpl = '';
15
+ copyTmpl += '<div class="code-widget">';
16
+ copyTmpl += 'LANG';
17
+ copyTmpl += '</div>';
18
+ jQuery('.markdown-body pre').each(function() {
19
+ var $pre = jQuery(this);
20
+ if ($pre.find('code.mermaid').length > 0) {
21
+ return;
22
+ }
23
+ if ($pre.find('span.line').length > 0) {
24
+ return;
25
+ }
26
+
27
+ var lang = '';
28
+
29
+ if (enableLang) {
30
+ lang = CONFIG.code_language.default;
31
+ if ($pre[0].children.length > 0 && $pre[0].children[0].classList.length >= 2 && $pre.children().hasClass('hljs')) {
32
+ lang = $pre[0].children[0].classList[1];
33
+ } else if ($pre[0].getAttribute('data-language')) {
34
+ lang = $pre[0].getAttribute('data-language');
35
+ } else if ($pre.parent().hasClass('sourceCode') && $pre[0].children.length > 0 && $pre[0].children[0].classList.length >= 2) {
36
+ lang = $pre[0].children[0].classList[1];
37
+ $pre.parent().addClass('code-wrapper');
38
+ } else if ($pre.parent().hasClass('markdown-body') && $pre[0].classList.length === 0) {
39
+ $pre.wrap('<div class="code-wrapper"></div>');
40
+ }
41
+ lang = lang.toUpperCase().replace('NONE', CONFIG.code_language.default);
42
+ }
43
+ $pre.append(copyTmpl.replace('LANG', lang).replace('code-widget">',
44
+ getBgClass($pre[0]) + (enableCopy ? ' code-widget copy-btn" data-clipboard-snippet><i class="iconfont icon-copy"></i>' : ' code-widget">')));
45
+
46
+ if (enableCopy) {
47
+ Fluid.utils.createScript('${url_join(theme.static_prefix.clipboard, 'clipboard.min.js')}', function() {
48
+ var clipboard = new window.ClipboardJS('.copy-btn', {
49
+ target: function(trigger) {
50
+ var nodes = trigger.parentNode.childNodes;
51
+ for (var i = 0; i < nodes.length; i++) {
52
+ if (nodes[i].tagName === 'CODE') {
53
+ return nodes[i];
54
+ }
55
+ }
56
+ }
57
+ });
58
+ clipboard.on('success', function(e) {
59
+ e.clearSelection();
60
+ e.trigger.innerHTML = e.trigger.innerHTML.replace('icon-copy', 'icon-success');
61
+ setTimeout(function() {
62
+ e.trigger.innerHTML = e.trigger.innerHTML.replace('icon-success', 'icon-copy');
63
+ }, 2000);
64
+ });
65
+ });
66
+ }
67
+ });
68
+ })();
69
+ </script>
70
+ `)
71
+ %>
@@ -0,0 +1,11 @@
1
+ <%
2
+ import_css(theme.static_prefix.fancybox, 'jquery.fancybox.min.css')
3
+
4
+ import_script(`
5
+ <script>
6
+ Fluid.utils.createScript('${url_join(theme.static_prefix.fancybox, 'jquery.fancybox.min.js')}', function() {
7
+ Fluid.plugins.fancyBox();
8
+ });
9
+ </script>
10
+ `)
11
+ %>
@@ -0,0 +1,13 @@
1
+ <%
2
+ if (theme.code.highlight.lib === 'prismjs') {
3
+ if (!theme.code.highlight.prismjs.preprocess) {
4
+ import_js(theme.static_prefix.prismjs, 'components/prism-core.min.js')
5
+ import_js(theme.static_prefix.prismjs, 'plugins/autoloader/prism-autoloader.min.js')
6
+ }
7
+
8
+ if (theme.code.highlight.line_number) {
9
+ import_css(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.css')
10
+ import_js(theme.static_prefix.prismjs, '/plugins/line-numbers/prism-line-numbers.min.js')
11
+ }
12
+ }
13
+ %>