hexo-theme-volantis 4.3.1 → 5.0.0-alpha.112
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.
- package/README.md +6 -4
- package/_config.yml +599 -246
- package/languages/en.yml +7 -0
- package/languages/zh-CN.yml +13 -2
- package/languages/zh-TW.yml +7 -0
- package/layout/404.ejs +1 -1
- package/layout/_meta/author.ejs +4 -4
- package/layout/_meta/category.ejs +11 -8
- package/layout/_meta/counter.ejs +29 -7
- package/layout/_meta/date.ejs +1 -1
- package/layout/_meta/music.ejs +1 -1
- package/layout/_meta/share.ejs +1 -1
- package/layout/_meta/tags.ejs +3 -0
- package/layout/_meta/thumbnail.ejs +3 -1
- package/layout/_meta/updated.ejs +1 -1
- package/layout/_meta/walinecount.ejs +2 -1
- package/layout/{_cover → _partial/_cover}/blank.ejs +0 -0
- package/layout/{_cover → _partial/_cover}/dock.ejs +1 -1
- package/layout/{_cover → _partial/_cover}/featured.ejs +1 -1
- package/layout/{_cover → _partial/_cover}/focus.ejs +1 -1
- package/layout/_partial/_cover/layout.ejs +8 -0
- package/layout/{_cover → _partial/_cover}/search.ejs +2 -2
- package/layout/_partial/archive.ejs +2 -2
- package/layout/_partial/article.ejs +21 -16
- package/layout/_partial/categories.ejs +1 -1
- package/layout/_partial/cover.ejs +8 -28
- package/layout/_partial/footer.ejs +19 -11
- package/layout/_partial/head.ejs +70 -116
- package/layout/_partial/header.ejs +17 -11
- package/layout/_partial/meta.ejs +18 -4
- package/layout/_partial/post.ejs +35 -9
- package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +126 -0
- package/layout/_partial/scripts/{coverCtrl.ejs → _ctrl/coverCtrl.ejs} +17 -25
- package/layout/_partial/scripts/_ctrl.ejs +2 -0
- package/layout/_partial/scripts/content-visibility-scroll-fix.ejs +88 -0
- package/layout/_partial/scripts/global.ejs +422 -109
- package/layout/_partial/scripts/index.ejs +91 -46
- package/layout/_partial/scripts/toc.ejs +98 -68
- package/layout/_partial/side.ejs +4 -1
- package/layout/_plugins/_page_plugins/artitalk/index.ejs +15 -0
- package/layout/_plugins/_page_plugins/bbtalk/index.ejs +10 -0
- package/layout/_plugins/_page_plugins/fcircle/index.ejs +12 -0
- package/layout/_plugins/_page_plugins/gitter/index.ejs +14 -0
- package/layout/_plugins/_page_plugins/indent/index.ejs +16 -0
- package/layout/_plugins/_page_plugins/index.ejs +27 -0
- package/layout/_plugins/_page_plugins/katex/index.ejs +13 -0
- package/layout/{_third-party/math/mathjax/script.ejs → _plugins/_page_plugins/mathjax/index.ejs} +2 -2
- package/layout/_plugins/_page_plugins/snackbar/index.ejs +55 -0
- package/layout/{_partial/scripts/counter.ejs → _plugins/analytics/LCCounter.ejs} +0 -0
- package/layout/{_third-party → _plugins}/analytics/script.ejs +43 -5
- package/layout/{_third-party → _plugins}/aplayer/layout.ejs +0 -0
- package/layout/_plugins/aplayer/script.ejs +74 -0
- package/layout/_plugins/chat/gitter/script.ejs +17 -0
- package/layout/_plugins/chat/index.ejs +1 -0
- package/layout/_plugins/chat/tidio/script.ejs +1 -0
- package/layout/_plugins/comments/artalk/script.ejs +59 -0
- package/layout/_plugins/comments/beaudar/script.ejs +61 -0
- package/layout/_plugins/comments/discuss/script.ejs +30 -0
- package/layout/_plugins/comments/disqus/script.ejs +98 -0
- package/layout/_plugins/comments/disqusjs/script.ejs +35 -0
- package/layout/_plugins/comments/giscus/script.ejs +47 -0
- package/layout/_plugins/comments/gitalk/script.ejs +24 -0
- package/layout/_plugins/comments/hashover/script.ejs +5 -0
- package/layout/{_third-party → _plugins}/comments/index.ejs +10 -3
- package/layout/_plugins/comments/isso/script.ejs +27 -0
- package/layout/_plugins/comments/livere/script.ejs +15 -0
- package/layout/_plugins/comments/twikoo/script.ejs +40 -0
- package/layout/_plugins/comments/utterances/script.ejs +43 -0
- package/layout/_plugins/comments/vssue/script.ejs +37 -0
- package/layout/_plugins/comments/waline/script.ejs +62 -0
- package/layout/_plugins/comments/z-custom/script.ejs +1 -0
- package/layout/_plugins/darkmode/script.ejs +114 -0
- package/layout/{_third-party → _plugins}/end-of-support/script.ejs +25 -8
- package/layout/_plugins/github-api/script.ejs +27 -0
- package/layout/_plugins/highlight/highlightjs/script.ejs +26 -0
- package/layout/_plugins/highlight/prismjs/script.ejs +25 -0
- package/layout/_plugins/highlight/script.ejs +1 -0
- package/layout/{_third-party → _plugins}/lazyload/script.ejs +1 -1
- package/layout/{_third-party → _plugins}/nodewaves/script.ejs +1 -1
- package/layout/_plugins/parallax/script.ejs +74 -0
- package/layout/{_third-party → _plugins}/pjax/animate.ejs +31 -31
- package/layout/_plugins/pjax/index.ejs +73 -0
- package/layout/_plugins/pjax/pdata.ejs +56 -0
- package/layout/{_third-party → _plugins}/preload/script.ejs +3 -3
- package/layout/_plugins/rightmenu/layout.ejs +119 -0
- package/layout/_plugins/rightmenus/layout.ejs +137 -0
- package/layout/_plugins/scrollreveal/script.ejs +25 -0
- package/layout/_plugins/search/script.ejs +50 -0
- package/layout/{_third-party → _plugins}/share/layout.ejs +0 -0
- package/layout/_plugins/swiper/script.ejs +37 -0
- package/layout/_pre.ejs +2 -2
- package/layout/_widget/_pre.ejs +5 -0
- package/layout/_widget/blogger.ejs +1 -1
- package/layout/_widget/category.ejs +2 -2
- package/layout/_widget/copyright.ejs +1 -1
- package/layout/_widget/grid.ejs +3 -3
- package/layout/_widget/lastupdate.ejs +27 -0
- package/layout/_widget/list.ejs +2 -2
- package/layout/_widget/load.ejs +18 -0
- package/layout/_widget/music.ejs +3 -2
- package/layout/_widget/page.ejs +1 -1
- package/layout/_widget/qrcode.ejs +1 -1
- package/layout/_widget/related_posts.ejs +1 -1
- package/layout/_widget/tagcloud.ejs +1 -1
- package/layout/_widget/text.ejs +1 -1
- package/layout/_widget/toc.ejs +6 -2
- package/layout/_widget/webinfo.ejs +13 -76
- package/layout/archive.ejs +4 -4
- package/layout/category.ejs +9 -4
- package/layout/docs.ejs +1 -1
- package/layout/friends.ejs +6 -25
- package/layout/index.ejs +1 -1
- package/layout/layout.ejs +30 -12
- package/layout/list.ejs +1 -1
- package/layout/page.ejs +1 -1
- package/layout/post.ejs +1 -1
- package/layout/tag.ejs +8 -3
- package/package.json +5 -3
- package/scripts/events/index.js +13 -0
- package/scripts/events/lib/check-configuration.js +43 -0
- package/scripts/events/lib/check-environment.js +74 -0
- package/scripts/events/lib/config.js +34 -9
- package/scripts/events/lib/render-stylus.js +78 -0
- package/scripts/events/lib/stellar-tag-utils.js +76 -0
- package/scripts/filters/content-visibility.js +25 -0
- package/scripts/{render → filters}/img.js +0 -0
- package/scripts/filters/replace.js +15 -0
- package/scripts/{z-lazyload/lib/process.js → filters/z-lazyload.js} +6 -3
- package/scripts/helpers/custom-files.js +165 -0
- package/scripts/helpers/first-style.js +19 -0
- package/scripts/helpers/head/autoCanonical.js +15 -0
- package/scripts/helpers/head/generate_preload_fontfamily.js +22 -0
- package/scripts/helpers/head/generate_seo.js +24 -0
- package/scripts/helpers/head/generate_title__keywords__description.js +101 -0
- package/scripts/{related_posts/index.js → helpers/related-posts.js} +1 -1
- package/scripts/helpers/revisioned.js +158 -0
- package/scripts/helpers/structured-data/index.js +2 -0
- package/scripts/helpers/structured-data/lib/blogposting.js +77 -0
- package/scripts/helpers/structured-data/lib/breadcrumblist.js +152 -0
- package/scripts/helpers/structured-data/lib/config.js +31 -0
- package/scripts/helpers/structured-data/lib/index.js +30 -0
- package/scripts/helpers/structured-data/lib/organization.js +15 -0
- package/scripts/helpers/structured-data/lib/person.js +16 -0
- package/scripts/helpers/structured-data/lib/website.js +42 -0
- package/scripts/tags/btn.js +6 -1
- package/scripts/tags/btns.js +7 -2
- package/scripts/tags/checkbox.js +12 -2
- package/scripts/tags/contributors.js +100 -0
- package/scripts/tags/dropmenu.js +18 -3
- package/scripts/tags/fancybox.js +44 -10
- package/scripts/tags/folding.js +6 -1
- package/scripts/tags/frame.js +6 -1
- package/scripts/tags/friends.js +99 -0
- package/scripts/tags/ghcard.js +6 -1
- package/scripts/tags/image.js +14 -2
- package/scripts/tags/link.js +6 -1
- package/scripts/tags/md.js +59 -0
- package/scripts/tags/media.js +25 -1
- package/scripts/tags/note.js +36 -3
- package/scripts/tags/site.js +87 -51
- package/scripts/tags/span.js +12 -2
- package/scripts/tags/swiper.js +38 -0
- package/scripts/tags/tabs.js +33 -3
- package/scripts/tags/timeline.js +6 -1
- package/source/css/Readme.md +28 -0
- package/source/css/_defines/AutoPrefixCSS.styl +347 -0
- package/source/css/_defines/Readme.md +3 -0
- package/source/css/_defines/color.styl +41 -1
- package/source/css/_defines/effect.styl +0 -13
- package/source/css/_defines/fonts.styl +17 -18
- package/source/css/_defines/func.styl +12 -30
- package/source/css/_first/base_first.styl +118 -0
- package/source/css/_first/{cover.styl → cover_first.styl} +113 -87
- package/source/css/_first/dark_first.styl +76 -0
- package/source/css/_first/fontfamily_first.styl +17 -0
- package/source/css/_first/{navbar.styl → navbar_first.styl} +4 -10
- package/source/css/_first/search_first.styl +12 -0
- package/source/css/{_base/index.styl → _style/_base/base.styl} +9 -93
- package/source/css/_style/_base/fontfamily_async.styl +8 -0
- package/source/css/{_layout → _style/_layout}/archive.styl +0 -0
- package/source/css/{_layout → _style/_layout}/article.styl +3 -30
- package/source/css/{_layout → _style/_layout}/footer.styl +0 -0
- package/source/css/_style/_layout/friends-simpleuser.styl +23 -0
- package/source/css/_style/_layout/friends-traditional.styl +81 -0
- package/source/css/{_layout → _style/_layout}/img.styl +0 -0
- package/source/css/_style/_layout/loading.styl +14 -0
- package/source/css/{_layout → _style/_layout}/main.styl +19 -7
- package/source/css/{_layout → _style/_layout}/md.styl +0 -0
- package/source/css/{_layout → _style/_layout}/pagination.styl +1 -1
- package/source/css/{_layout → _style/_layout}/posts.styl +2 -0
- package/source/css/{_first → _style/_layout}/search.styl +0 -103
- package/source/css/{_layout → _style/_layout}/sidebar.styl +23 -3
- package/source/css/{_layout → _style/_layout}/snackbar.styl +0 -0
- package/source/css/{_layout → _style/_layout}/toc.styl +3 -3
- package/source/css/{_layout → _style/_layout}/video.styl +0 -0
- package/source/css/_style/_plugins/_dark/dark_async.styl +41 -0
- package/source/css/_style/_plugins/_dark/dark_plugins.styl +136 -0
- package/source/css/_style/_plugins/_highlight/highlightjs/clipboard.styl +36 -0
- package/source/css/_style/_plugins/_highlight/highlightjs/color.styl +96 -0
- package/source/css/_style/_plugins/_highlight/highlightjs/index.styl +102 -0
- package/source/css/_style/_plugins/_highlight/highlightjs/language.styl +63 -0
- package/source/css/_style/_plugins/_highlight/index.styl +1 -0
- package/source/css/_style/_plugins/_highlight/prismjs/clipboard.styl +33 -0
- package/source/css/_style/_plugins/_highlight/prismjs/index.styl +8 -0
- package/source/css/_style/_plugins/_highlight/prismjs/language.styl +63 -0
- package/source/css/_style/_plugins/_rightmenu/reading.styl +56 -0
- package/source/css/{_plugins → _style/_plugins/_rightmenu}/rightmenu.styl +22 -2
- package/source/css/{_plugins → _style/_plugins}/aplayer.styl +8 -1
- package/source/css/{_plugins → _style/_plugins}/cursor.styl +49 -19
- package/source/css/_style/_plugins/fontcolor.styl +84 -0
- package/source/css/{_plugins → _style/_plugins}/gitalk.styl +0 -0
- package/source/css/_style/_plugins/index.styl +24 -0
- package/source/css/{_plugins → _style/_plugins}/mathjax.styl +0 -0
- package/source/css/_style/_plugins/message.styl +14 -0
- package/source/css/{_plugins → _style/_plugins}/pjaxanimate.styl +0 -0
- package/source/css/_style/_tag-plugins/Readme.md +6 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/btns.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/checkbox.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/dropmenu.styl +0 -0
- package/source/css/{_plugins → _style/_tag-plugins}/fancybox.styl +8 -9
- package/source/css/{_tag-plugins → _style/_tag-plugins}/folding.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/frame.styl +0 -0
- package/source/css/_style/_tag-plugins/friends.styl +72 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/ghcard.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/image.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/link.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/media.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/note.styl +0 -0
- package/source/css/_style/_tag-plugins/sites.styl +87 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/span.styl +0 -0
- package/source/css/_style/_tag-plugins/swiper.styl +44 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/table.styl +0 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/tabs.styl +0 -0
- package/source/css/_style/_tag-plugins/tag.json +35 -0
- package/source/css/_style/_tag-plugins/text.styl +31 -0
- package/source/css/{_tag-plugins → _style/_tag-plugins}/timeline.styl +0 -0
- package/source/css/_style/index.styl +8 -0
- package/source/css/first.styl +17 -6
- package/source/css/style.styl +9 -7
- package/source/js/app.js +1051 -278
- package/source/js/plugins/aplayer.js +186 -0
- package/source/js/plugins/parallax.js +191 -0
- package/source/js/plugins/rightMenu.js +577 -0
- package/source/js/plugins/rightMenus.js +616 -0
- package/source/js/plugins/tags/contributors.js +92 -0
- package/source/js/plugins/tags/friends.js +93 -0
- package/source/js/plugins/tags/sites.js +96 -0
- package/source/js/search/hexo.js +180 -373
- package/.eslintrc.json +0 -111
- package/layout/_meta/valinecount.ejs +0 -15
- package/layout/_partial/rightmenu.ejs +0 -199
- package/layout/_partial/scripts/cover.ejs +0 -45
- package/layout/_partial/scripts/darkmode.ejs +0 -85
- package/layout/_partial/scripts/import.ejs +0 -3
- package/layout/_partial/scripts/issues.ejs +0 -18
- package/layout/_partial/scripts/search.ejs +0 -62
- package/layout/_partial/snackbar.ejs +0 -22
- package/layout/_third-party/aplayer/script.ejs +0 -26
- package/layout/_third-party/clipboard/script.ejs +0 -54
- package/layout/_third-party/comments/disqus/layout.ejs +0 -5
- package/layout/_third-party/comments/disqus/script.ejs +0 -90
- package/layout/_third-party/comments/disqusjs/layout.ejs +0 -1
- package/layout/_third-party/comments/disqusjs/script.ejs +0 -34
- package/layout/_third-party/comments/gitalk/layout.ejs +0 -1
- package/layout/_third-party/comments/gitalk/script.ejs +0 -22
- package/layout/_third-party/comments/hashover/layout.ejs +0 -2
- package/layout/_third-party/comments/hashover/script.ejs +0 -1
- package/layout/_third-party/comments/isso/layout.ejs +0 -1
- package/layout/_third-party/comments/isso/script.ejs +0 -1
- package/layout/_third-party/comments/livere/layout.ejs +0 -3
- package/layout/_third-party/comments/livere/script.ejs +0 -10
- package/layout/_third-party/comments/minivaline/layout.ejs +0 -3
- package/layout/_third-party/comments/minivaline/script.ejs +0 -34
- package/layout/_third-party/comments/twikoo/layout.ejs +0 -3
- package/layout/_third-party/comments/twikoo/script.ejs +0 -32
- package/layout/_third-party/comments/valine/layout.ejs +0 -3
- package/layout/_third-party/comments/valine/script.ejs +0 -49
- package/layout/_third-party/comments/vssue/layout.ejs +0 -1
- package/layout/_third-party/comments/vssue/script.ejs +0 -21
- package/layout/_third-party/comments/waline/layout.ejs +0 -3
- package/layout/_third-party/comments/waline/script.ejs +0 -33
- package/layout/_third-party/fancybox/script.ejs +0 -61
- package/layout/_third-party/highlightjs/script.ejs +0 -11
- package/layout/_third-party/pjax/index.ejs +0 -78
- package/layout/_third-party/pjax/pdata.ejs +0 -53
- package/layout/_third-party/scrollreveal/script.ejs +0 -21
- package/layout/_third-party/tidio/script.ejs +0 -3
- package/layout/artitalk.ejs +0 -13
- package/layout/bb.ejs +0 -10
- package/package-lock.json +0 -916
- package/scripts/tags/issues.js +0 -41
- package/scripts/z-lazyload/index.js +0 -4
- package/source/css/_highlight/index.styl +0 -316
- package/source/css/_layout/friends.styl +0 -79
- package/source/css/_plugins/clipboard.styl +0 -37
- package/source/css/_plugins/dark.styl +0 -149
- package/source/css/_plugins/darkmode.styl +0 -9
- package/source/css/_plugins/index.styl +0 -18
- package/source/css/_plugins/twikoo.styl +0 -21
- package/source/css/_plugins/valine.styl +0 -183
- package/source/css/_tag-plugins/simpleuser.styl +0 -21
- package/source/css/_tag-plugins/site-card.styl +0 -70
- package/source/js/aplayer.js +0 -167
- package/source/js/issues.js +0 -186
- package/source/js/search/algolia.js +0 -344
- package/source/js/search/azure.js +0 -355
- package/source/js/search/baidu.js +0 -340
- package/source/js/search/google.js +0 -339
- package/source/js/valine.js +0 -5137
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<section class="widget <%- page.widget_style %> <%- page.widget_platform %>">
|
|
2
|
+
<section class="widget <%- page.widget_style %> <%- page.widget_platform %> <%- page.widget_pjax %>">
|
|
3
3
|
<%- partial('header', {item: item}) %>
|
|
4
4
|
<div class='content'>
|
|
5
5
|
<div class="webinfo">
|
|
@@ -13,15 +13,8 @@
|
|
|
13
13
|
<% if (item.type.runtime.enable) { %>
|
|
14
14
|
<div class="webinfo-item">
|
|
15
15
|
<div><%= item.type.runtime.text %></div>
|
|
16
|
-
<div id="webinfo-runtime-count"
|
|
16
|
+
<div id="webinfo-runtime-count"></div>
|
|
17
17
|
</div>
|
|
18
|
-
<script>
|
|
19
|
-
var BirthDay = new Date(new Date('<%= item.type.runtime.data %>'));
|
|
20
|
-
var today = new Date();
|
|
21
|
-
var timeold = (today.getTime() - BirthDay.getTime());
|
|
22
|
-
var daysold = Math.floor(timeold / (24 * 60 * 60 * 1000));
|
|
23
|
-
document.getElementById('webinfo-runtime-count').innerHTML = daysold + ' <%= item.type.runtime.unit %>';
|
|
24
|
-
</script>
|
|
25
18
|
<% } %>
|
|
26
19
|
|
|
27
20
|
|
|
@@ -32,24 +25,24 @@
|
|
|
32
25
|
</div>
|
|
33
26
|
<% } %>
|
|
34
27
|
|
|
35
|
-
<% if (item.type.visitcounter.siteuv.enable &&
|
|
28
|
+
<% if (item.type.visitcounter.siteuv.enable && (!!theme.analytics.busuanz || !!theme.analytics.leancloud.app_id)) { %>
|
|
36
29
|
<div class="webinfo-item">
|
|
37
30
|
<div><%= item.type.visitcounter.siteuv.text %></div>
|
|
38
|
-
<% if (
|
|
39
|
-
<div><span id="busuanzi_value_site_uv"><i class="
|
|
40
|
-
<% } else
|
|
41
|
-
<div><span id="lc-uv"><span id='number'><i class="
|
|
31
|
+
<% if (!!theme.analytics.busuanz) {%>
|
|
32
|
+
<div><span id="busuanzi_value_site_uv"><i class="fa-solid fa-fan fa-spin fa-fw" aria-hidden="true"></i></span> <%= item.type.visitcounter.siteuv.unit %></div>
|
|
33
|
+
<% } else { %>
|
|
34
|
+
<div><span id="lc-uv"><span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.siteuv.unit %></div>
|
|
42
35
|
<% } %>
|
|
43
36
|
</div>
|
|
44
37
|
<% } %>
|
|
45
38
|
|
|
46
|
-
<% if (item.type.visitcounter.sitepv.enable &&
|
|
39
|
+
<% if (item.type.visitcounter.sitepv.enable && (!!theme.analytics.busuanz || !!theme.analytics.leancloud.app_id)) { %>
|
|
47
40
|
<div class="webinfo-item">
|
|
48
41
|
<div><%= item.type.visitcounter.sitepv.text %></div>
|
|
49
|
-
<% if (
|
|
50
|
-
<div><span id="busuanzi_value_site_pv"><i class="
|
|
51
|
-
<% } else
|
|
52
|
-
<div><span id="lc-sv"><span id='number'><i class="
|
|
42
|
+
<% if (!!theme.analytics.busuanz) {%>
|
|
43
|
+
<div><span id="busuanzi_value_site_pv"><i class="fa-solid fa-fan fa-spin fa-fw" aria-hidden="true"></i></span> <%= item.type.visitcounter.sitepv.unit %></div>
|
|
44
|
+
<% } else { %>
|
|
45
|
+
<div><span id="lc-sv"><span id='number'><i class="fa-solid fa-circle-notch fa-spin fa-fw" aria-hidden="true"></i></span></span> <%= item.type.visitcounter.sitepv.unit %></div>
|
|
53
46
|
<% } %>
|
|
54
47
|
</div>
|
|
55
48
|
<% } %>
|
|
@@ -57,64 +50,8 @@
|
|
|
57
50
|
<% if (item.type.lastupd.enable) { %>
|
|
58
51
|
<div class="webinfo-item">
|
|
59
52
|
<div><%= item.type.lastupd.text %></div>
|
|
60
|
-
|
|
61
|
-
<div id="last-update" style="display: none;"><%= new Date() %></div>
|
|
62
|
-
<div id="last-update-show"><%- date(Date.now()) %> <%= item.type.lastupd.unit %></div>
|
|
63
|
-
<% } else { %>
|
|
64
|
-
<div><%- date(Date.now()) %> <%= item.type.lastupd.unit %></div>
|
|
65
|
-
<% } %>
|
|
53
|
+
<div id="last-update-show"><%- date(Date.now()) %> <%= item.type.lastupd.unit %></div>
|
|
66
54
|
</div>
|
|
67
|
-
<% if (item.type.lastupd.friendlyShow) { %>
|
|
68
|
-
<script>
|
|
69
|
-
function timeago(dateTimeStamp) {
|
|
70
|
-
var minute = 1000 * 60; //把分,时,天,周,半个月,一个月用毫秒表示
|
|
71
|
-
var hour = minute * 60;
|
|
72
|
-
var day = hour * 24;
|
|
73
|
-
var week = day * 7;
|
|
74
|
-
var month = day * 30;
|
|
75
|
-
var now = new Date().getTime(); //获取当前时间毫秒
|
|
76
|
-
var diffValue = now - dateTimeStamp; //时间差
|
|
77
|
-
if (diffValue < 0) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
var minC = diffValue / minute; //计算时间差的分,时,天,周,月
|
|
81
|
-
var hourC = diffValue / hour;
|
|
82
|
-
var dayC = diffValue / day;
|
|
83
|
-
var weekC = diffValue / week;
|
|
84
|
-
var monthC = diffValue / month;
|
|
85
|
-
if (monthC >= 1 && monthC <= 3) {
|
|
86
|
-
result = " " + parseInt(monthC) + " 月前"
|
|
87
|
-
} else if (weekC >= 1 && weekC <= 3) {
|
|
88
|
-
result = " " + parseInt(weekC) + " 周前"
|
|
89
|
-
} else if (dayC >= 1 && dayC <= 6) {
|
|
90
|
-
result = " " + parseInt(dayC) + " 天前"
|
|
91
|
-
} else if (hourC >= 1 && hourC <= 23) {
|
|
92
|
-
result = " " + parseInt(hourC) + " 小时前"
|
|
93
|
-
} else if (minC >= 1 && minC <= 59) {
|
|
94
|
-
result = " " + parseInt(minC) + " 分钟前"
|
|
95
|
-
} else if (diffValue >= 0 && diffValue <= minute) {
|
|
96
|
-
result = "刚刚"
|
|
97
|
-
} else {
|
|
98
|
-
var datetime = new Date();
|
|
99
|
-
datetime.setTime(dateTimeStamp);
|
|
100
|
-
var Nyear = datetime.getFullYear();
|
|
101
|
-
var Nmonth = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
|
|
102
|
-
var Ndate = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
|
|
103
|
-
var Nhour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
|
|
104
|
-
var Nminute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
|
|
105
|
-
var Nsecond = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
|
|
106
|
-
result = Nyear + "-" + Nmonth + "-" + Ndate
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
var lastUpDate = document.getElementById('last-update').innerHTML;
|
|
111
|
-
try {
|
|
112
|
-
document.getElementById('last-update-show').innerHTML = timeago(new Date(lastUpDate));
|
|
113
|
-
} catch (error) {
|
|
114
|
-
document.getElementById('last-update-show').innerHTML = '<%- date(Date.now()) %> <%= item.type.lastupd.unit %>';
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
<% } %>
|
|
118
55
|
<% } %>
|
|
119
56
|
</div>
|
|
120
57
|
</div>
|
package/layout/archive.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<div class='
|
|
2
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
3
3
|
<% if (page.year || page.month) { %>
|
|
4
4
|
<%- partial('_partial/archive') %>
|
|
5
5
|
<% } else { %>
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
<div class='timenode'>
|
|
16
16
|
<a class="meta" href="<%= url_for(post.link || post.path) %>">
|
|
17
17
|
<time><%= date(post.date, 'MM-DD') %></time>
|
|
18
|
-
<% if(post.title){ %>
|
|
19
|
-
<%- post.title %>
|
|
18
|
+
<% if(post.title || post.seo_title){ %>
|
|
19
|
+
<%- post.title || post.seo_title %>
|
|
20
20
|
<% } else if (post.date) { %>
|
|
21
21
|
<%= date(post.date, config.date_format) %>
|
|
22
22
|
<% } %>
|
|
23
23
|
<% if(theme.plugins.aplayer && theme.plugins.aplayer.enable && post.music && post.music.enable != false){ %>
|
|
24
|
-
<i class="
|
|
24
|
+
<i class="fa-solid fa-headphones-alt music" aria-hidden="true"></i>
|
|
25
25
|
<% } %>
|
|
26
26
|
<% if (post.icon) { %>
|
|
27
27
|
<i class="<%- post.icon %>" aria-hidden="true"></i>
|
package/layout/category.ejs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<%
|
|
3
|
-
|
|
2
|
+
<%
|
|
3
|
+
page.comments = false;
|
|
4
|
+
if (!page.robots) {
|
|
5
|
+
page.robots = 'noindex,follow';
|
|
6
|
+
}
|
|
7
|
+
%>
|
|
8
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
4
9
|
<% if (site.posts && site.posts.length > 0) { %>
|
|
5
|
-
<% if (page.layout == 'category') { %>
|
|
10
|
+
<% if ((page.layout == 'category')||(page.layout == 'categories') ) { %>
|
|
6
11
|
<div class='post-wrapper'>
|
|
7
12
|
<article id="cat" class="post article white-box reveal <%- theme.custom_css.body.effect.join(' ') %>">
|
|
8
13
|
<h2><%- page.title %></h2>
|
|
@@ -10,7 +15,7 @@
|
|
|
10
15
|
<% if (site.categories.length){ %>
|
|
11
16
|
<% site.categories.sort('path').each(function(category){ %>
|
|
12
17
|
<a class="<%= category.parent ? ' child' : ''%>" href="<%= url_for(category.path) %>">
|
|
13
|
-
<span><i class='
|
|
18
|
+
<span><i class='fa-solid fa-folder-open fa-fw' aria-hidden="true"></i> <%= category.name %></span>
|
|
14
19
|
<span class="title">
|
|
15
20
|
(<%- category.posts.length %>)
|
|
16
21
|
</span>
|
package/layout/docs.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<div class='
|
|
2
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
3
3
|
<%- partial('_partial/article', {post: page, index: false}) %>
|
|
4
4
|
</div>
|
|
5
5
|
<%- partial('_partial/side') %>
|
package/layout/friends.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<div class='
|
|
2
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
3
3
|
<article id="<%= page.layout %>" class="md post article article-entry l_friends white-box reveal <%- theme.custom_css.body.effect.join(' ') %> article-type-<%= page.layout %>" itemscope itemprop="blogPost">
|
|
4
4
|
<%- partial('_partial/meta',{post: page, position: 'top'}) %>
|
|
5
5
|
<%- page.excerpt %>
|
|
@@ -13,31 +13,12 @@
|
|
|
13
13
|
<% if (group.description) { %>
|
|
14
14
|
<%- markdown(group.description) %>
|
|
15
15
|
<%} %>
|
|
16
|
-
<% if (theme.pages.friends.layout_scheme == '
|
|
17
|
-
<div class='site-card-group'>
|
|
18
|
-
<% (group.items||[]).forEach(function(item){ %>
|
|
19
|
-
<% if (item.url && item.title) { %>
|
|
20
|
-
<a class="site-card" target="_blank" rel="external nofollow noopener noreferrer" href="<%- url_for(item.url || '/') %>">
|
|
21
|
-
<div class="img">
|
|
22
|
-
<% if (item.screenshot) { %>
|
|
23
|
-
<img src="<%- item.screenshot %>"/>
|
|
24
|
-
<% } %>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="info">
|
|
27
|
-
<img src="<%- item.avatar || (theme.plugins.lazyload && theme.plugins.lazyload.loadingImg) %>"/>
|
|
28
|
-
<span class="title"><%- item.title %></span>
|
|
29
|
-
<span class="desc"><%- item.description %></span>
|
|
30
|
-
</div>
|
|
31
|
-
</a>
|
|
32
|
-
<% } %>
|
|
33
|
-
<% }) %>
|
|
34
|
-
</div>
|
|
35
|
-
<% } else if (theme.pages.friends.layout_scheme == 'traditional') { %>
|
|
16
|
+
<% if (theme.pages.friends.layout_scheme == 'traditional') { %>
|
|
36
17
|
<div class='friend-content'>
|
|
37
18
|
<% (group.items||[]).forEach(function(item){ %>
|
|
38
19
|
<% if (item.url && item.title) { %>
|
|
39
20
|
<a class='friend-card'
|
|
40
|
-
target="_blank" rel="external
|
|
21
|
+
target="_blank" rel="external noopener noreferrer" href="<%- url_for(item.url || '/') %>">
|
|
41
22
|
<div class='friend-left'>
|
|
42
23
|
<% if (item.avatar) { %>
|
|
43
24
|
<img class='avatar' src='<%- item.avatar || (theme.plugins.lazyload && theme.plugins.lazyload.loadingImg) %>'/>
|
|
@@ -48,7 +29,7 @@
|
|
|
48
29
|
<% if (item.keywords) { %>
|
|
49
30
|
<div class='friend-tags-wrapper'>
|
|
50
31
|
<% (item.keywords||[]).forEach(function(keyword){ %>
|
|
51
|
-
<p class="tags"><i class="
|
|
32
|
+
<p class="tags"><i class="fa-solid fa-hashtag fa-fw" aria-hidden="true"></i><%= keyword %></p>
|
|
52
33
|
<% }) %>
|
|
53
34
|
</div>
|
|
54
35
|
<% } %>
|
|
@@ -66,7 +47,7 @@
|
|
|
66
47
|
<div class='simpleuser-group'>
|
|
67
48
|
<% (group.items||[]).forEach(function(item){ %>
|
|
68
49
|
<% if (item.url && item.title) { %>
|
|
69
|
-
<a class="simpleuser" target="_blank" rel="external
|
|
50
|
+
<a class="simpleuser" target="_blank" rel="external noopener noreferrer" href="<%- url_for(item.url || '/') %>">
|
|
70
51
|
<img src="<%- item.avatar || (theme.plugins.lazyload && theme.plugins.lazyload.loadingImg) %>"/>
|
|
71
52
|
<span><%- item.title %></span>
|
|
72
53
|
</a>
|
|
@@ -82,7 +63,7 @@
|
|
|
82
63
|
<%- partial('_partial/meta',{post: page, position: 'bottom'}) %>
|
|
83
64
|
</article>
|
|
84
65
|
|
|
85
|
-
<%- partial('
|
|
66
|
+
<%- partial('_plugins/comments/index',{post: page}) %>
|
|
86
67
|
|
|
87
68
|
</div>
|
|
88
69
|
<%- partial('_partial/side') %>
|
package/layout/index.ejs
CHANGED
package/layout/layout.ejs
CHANGED
|
@@ -1,27 +1,45 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="<%- config.language %>">
|
|
3
|
-
<%- partial('_partial/
|
|
4
|
-
|
|
3
|
+
<%- partial('_partial/scripts/_ctrl') _%>
|
|
4
|
+
<%- partial('_partial/head') _%>
|
|
5
|
+
<body itemscope itemtype="http://schema.org/WebPage">
|
|
6
|
+
<!-- import body_begin begin-->
|
|
7
|
+
<%_ if (config.import && config.import.body_begin){ _%>
|
|
8
|
+
<%_ ([...config.import.body_begin]).forEach(function(item){ _%>
|
|
9
|
+
<%- item %>
|
|
10
|
+
<%_ }) _%>
|
|
11
|
+
<%_ } _%>
|
|
12
|
+
<!-- import body_begin end-->
|
|
13
|
+
<!-- Custom Files bodyBegin begin-->
|
|
14
|
+
<%- volantis_inject('bodyBegin') %>
|
|
15
|
+
<!-- Custom Files bodyBegin end-->
|
|
5
16
|
<%- partial('_partial/header', null, {cache: false, path: path}) %>
|
|
6
17
|
<div id="l_body">
|
|
7
18
|
<%- partial('_partial/cover') %>
|
|
8
19
|
<div id="safearea">
|
|
9
|
-
<div class="body-wrapper"
|
|
20
|
+
<div class="body-wrapper">
|
|
10
21
|
<%- body %>
|
|
11
|
-
|
|
12
|
-
<%- partial('_partial/snackbar') %>
|
|
13
|
-
<% } %>
|
|
14
|
-
<%- partial('_third-party/pjax/pdata') %>
|
|
22
|
+
<%- partial('_plugins/pjax/pdata') %>
|
|
15
23
|
</div>
|
|
16
24
|
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
|
|
17
|
-
<a id="s-top" class="
|
|
25
|
+
<a id="s-top" class="fa-solid fa-arrow-up fa-fw" href="/" onclick="return false;" title="top"></a>
|
|
18
26
|
</div>
|
|
19
27
|
</div>
|
|
20
28
|
<div>
|
|
21
|
-
<%- partial('_partial/scripts/index') %>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
<%- partial('_partial/scripts/index') %>
|
|
30
|
+
<% if (theme.plugins.pjax.enable){ %>
|
|
31
|
+
<%- partial('_plugins/pjax/index') %>
|
|
32
|
+
<% } %>
|
|
25
33
|
</div>
|
|
34
|
+
<!-- import body_end begin-->
|
|
35
|
+
<%_ if (config.import && config.import.body_end){ _%>
|
|
36
|
+
<%_ ([...config.import.body_end]).forEach(function(item){ _%>
|
|
37
|
+
<%- item %>
|
|
38
|
+
<%_ }) _%>
|
|
39
|
+
<%_ } _%>
|
|
40
|
+
<!-- import body_end end-->
|
|
41
|
+
<!-- Custom Files bodyEnd begin-->
|
|
42
|
+
<%- volantis_inject('bodyEnd') %>
|
|
43
|
+
<!-- Custom Files bodyEnd end-->
|
|
26
44
|
</body>
|
|
27
45
|
</html>
|
package/layout/list.ejs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
2
|
<% page.comments = false; %>
|
|
3
|
-
<div class='
|
|
3
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
4
4
|
<% if (site.pages && site.pages.length > 0) { %>
|
|
5
5
|
<section class="post-list">
|
|
6
6
|
<% site.pages.sort("-date").each(function(post){ %>
|
package/layout/page.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<div class='
|
|
2
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
3
3
|
<%- partial('_partial/article', {post: page, index: false}) %>
|
|
4
4
|
</div>
|
|
5
5
|
<%- partial('_partial/side') %>
|
package/layout/post.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<div class='
|
|
2
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
3
3
|
<%- partial('_partial/article', {post: page, index: false}) %>
|
|
4
4
|
</div>
|
|
5
5
|
<%- partial('_partial/side') %>
|
package/layout/tag.ejs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<%- partial('_pre') %>
|
|
2
|
-
<%
|
|
3
|
-
|
|
2
|
+
<%
|
|
3
|
+
page.comments = false;
|
|
4
|
+
if (!page.robots) {
|
|
5
|
+
page.robots = 'noindex,follow';
|
|
6
|
+
}
|
|
7
|
+
%>
|
|
8
|
+
<div id="l_main" class='<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
|
|
4
9
|
<% if (site.posts && site.posts.length > 0) { %>
|
|
5
|
-
<% if (page.layout == 'tag') { %>
|
|
10
|
+
<% if ((page.layout == 'tag')||(page.layout == 'tags')) { %>
|
|
6
11
|
<div class='post-wrapper'>
|
|
7
12
|
<article id="tag" class="post article white-box reveal <%- theme.custom_css.body.effect.join(' ') %>">
|
|
8
13
|
<h2><%- page.title %></h2>
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-theme-volantis",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.112",
|
|
4
4
|
"description": "Elegant and powerful theme for Hexo.",
|
|
5
5
|
"main": "package.json",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"eslint": "eslint scripts/ source/js --fix",
|
|
8
7
|
"test": "echo test"
|
|
9
8
|
},
|
|
10
9
|
"repository": {
|
|
@@ -23,6 +22,9 @@
|
|
|
23
22
|
},
|
|
24
23
|
"homepage": "https://volantis.js.org",
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"
|
|
25
|
+
"hexo": "^6.1.0",
|
|
26
|
+
"hexo-renderer-stylus": "^2.0.1",
|
|
27
|
+
"hexo-renderer-ejs": "^2.0.0",
|
|
28
|
+
"hexo-generator-json-content": "^4.2.3"
|
|
27
29
|
}
|
|
28
30
|
}
|
package/scripts/events/index.js
CHANGED
|
@@ -5,4 +5,17 @@
|
|
|
5
5
|
hexo.on('generateBefore', () => {
|
|
6
6
|
// Merge config.
|
|
7
7
|
require('./lib/config')(hexo);
|
|
8
|
+
require('./lib/stellar-tag-utils')(hexo);
|
|
9
|
+
require('./lib/render-stylus')(hexo);
|
|
10
|
+
require('./lib/check-environment')(hexo);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
hexo.on('ready', () => {
|
|
14
|
+
const { version } = require('../../package.json');
|
|
15
|
+
hexo.log.info(`
|
|
16
|
+
============================================================
|
|
17
|
+
Volantis ${version}
|
|
18
|
+
Docs: https://volantis.js.org/
|
|
19
|
+
Repo: https://github.com/volantis-x/hexo-theme-volantis/
|
|
20
|
+
============================================================`);
|
|
8
21
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module.exports =(hexo) => {
|
|
2
|
+
try {
|
|
3
|
+
let config = hexo.config;
|
|
4
|
+
let themeConfig = hexo.theme.config;
|
|
5
|
+
if (!config.title) {
|
|
6
|
+
return `title 未配置!
|
|
7
|
+
请在站点配置 _config.yml 中配置 title
|
|
8
|
+
see: https://hexo.io/zh-cn/docs/configuration
|
|
9
|
+
title not configured!
|
|
10
|
+
see: https://hexo.io/zh-cn/docs/configuration`
|
|
11
|
+
}
|
|
12
|
+
if (!config.description) {
|
|
13
|
+
return `description 未配置!
|
|
14
|
+
请在站点配置 _config.yml 中配置 description
|
|
15
|
+
description主要用于SEO,告诉搜索引擎一个关于您站点的简单描述,通常建议在其中包含您网站的关键词。
|
|
16
|
+
see: https://hexo.io/zh-cn/docs/configuration
|
|
17
|
+
description not configured!
|
|
18
|
+
see: https://hexo.io/zh-cn/docs/configuration`
|
|
19
|
+
}
|
|
20
|
+
if (themeConfig?.search?.service===`google`||themeConfig?.search?.service===`algolia`||themeConfig?.search?.service===`azure`||themeConfig?.search?.service===`baidu`) {
|
|
21
|
+
return `原 google, algolia, azure, baidu 站内搜索 系祖传代码, 且文档丢失, 不便后续维护 在 5.0 版本被移除
|
|
22
|
+
The google, algolia, azure, baidu site search is ancestral code, and the document is lost, which is inconvenient for subsequent maintenance. It was removed in version 5.0
|
|
23
|
+
see: https://volantis.js.org/v5/theme-settings/#站内搜索`
|
|
24
|
+
}
|
|
25
|
+
if (`backstretch` in themeConfig?.plugins) {
|
|
26
|
+
return `jquery.backstretch 在 5.0 版本被移除, 被 parallax 替代
|
|
27
|
+
jquery.backstretch was removed in version 5.0, replaced by parallax
|
|
28
|
+
see: https://volantis.js.org/v5/theme-settings/#幻灯片背景-视差滚动效果`
|
|
29
|
+
}
|
|
30
|
+
if ("valinecount" in themeConfig?.article?.body?.top_meta||"valinecount" in themeConfig?.article?.body?.bottom_meta||"valinecount" in themeConfig?.article?.body?.meta_library) {
|
|
31
|
+
return `ValineCount 在 5.0 版本被移除
|
|
32
|
+
ValineCount has been removed in 5.0 version
|
|
33
|
+
see: https://volantis.js.org/v5/theme-settings/#文章布局配置`
|
|
34
|
+
}
|
|
35
|
+
if (themeConfig?.comments?.service=="valine"||themeConfig?.comments?.service=="minivaline") {
|
|
36
|
+
return `Valine 在 5.0 版本被移除
|
|
37
|
+
Valine has been removed in 5.0 version
|
|
38
|
+
see: https://volantis.js.org/v5/theme-settings/#选择评论系统`
|
|
39
|
+
}
|
|
40
|
+
} catch (error) {}
|
|
41
|
+
return true;
|
|
42
|
+
};
|
|
43
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// 环境配置检查可以避免一些奇葩的报错
|
|
2
|
+
|
|
3
|
+
const exec = require('child_process').exec;
|
|
4
|
+
module.exports =(hexo) => {
|
|
5
|
+
if (!hexo.checkEnvironment) {
|
|
6
|
+
hexo.checkEnvironment=1;
|
|
7
|
+
hexo.log.info(`Checking environment configuration...`);
|
|
8
|
+
|
|
9
|
+
// Checking configuration
|
|
10
|
+
let checkConfiguration = require('./check-configuration')(hexo);
|
|
11
|
+
if (checkConfiguration!==true) {
|
|
12
|
+
CheckConfError(hexo,checkConfiguration);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Checking environment
|
|
16
|
+
exec('node -v', (err, stdout, stderr) => {
|
|
17
|
+
if (err) {
|
|
18
|
+
CheckError(hexo,`node.js: ${err}`);
|
|
19
|
+
}
|
|
20
|
+
let nodeVersion = stdout.match(/v(\d*)/)[1];
|
|
21
|
+
if (nodeVersion<14) {
|
|
22
|
+
hexo.log.info(`node.js 版本:${stdout}`);
|
|
23
|
+
CheckError(hexo,`node.js 版本过低,请升级至 v14.x 以上版本!`);
|
|
24
|
+
}else{
|
|
25
|
+
exec('hexo -v', (err, stdout, stderr) => {
|
|
26
|
+
if (err) {
|
|
27
|
+
CheckError(hexo,`hexo-cli: ${err}`);
|
|
28
|
+
}
|
|
29
|
+
let hexoVersion1 = stdout.match(/hexo:\s*(\d*)/)[1];
|
|
30
|
+
let hexoVersion2 = stdout.match(/hexo:\s*\d*\.(\d*)/)[1];
|
|
31
|
+
if (hexoVersion1<5 || (hexoVersion1==5 && hexoVersion2<4)) {
|
|
32
|
+
hexo.log.info(`hexo 版本:${stdout}`);
|
|
33
|
+
CheckError(hexo,`hexo 版本过低,请升级至 5.4 以上版本!`);
|
|
34
|
+
}else{
|
|
35
|
+
let hexoClVersion1 = stdout.match(/hexo-cli:\s*(\d*)/)[1];
|
|
36
|
+
let hexoClVersion2 = stdout.match(/hexo-cli:\s*\d*\.(\d*)/)[1];
|
|
37
|
+
if (hexoClVersion1<4 || (hexoClVersion1==4 && hexoClVersion2<1)) {
|
|
38
|
+
hexo.log.info(`hexo-cli 版本:${stdout}`);
|
|
39
|
+
CheckError(hexo,`hexo-cli 版本过低,请升级至 4.1 以上版本!`);
|
|
40
|
+
}else{
|
|
41
|
+
hexo.log.info(`Check environment configuration success!`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function CheckError(hexo,msg) {
|
|
51
|
+
hexo.log.error(`
|
|
52
|
+
============================================================
|
|
53
|
+
环境配置检查失败!| Environment configuration check failed!
|
|
54
|
+
============================================================
|
|
55
|
+
${msg}
|
|
56
|
+
============================================================
|
|
57
|
+
推荐的配置:
|
|
58
|
+
Hexo: 5.4 ~ 6.x
|
|
59
|
+
hexo-cli: 4.3 ~ latest
|
|
60
|
+
node.js: 16.x LTS ~ latest LTS
|
|
61
|
+
npm: 8.x ~ latest LTS
|
|
62
|
+
============================================================`);
|
|
63
|
+
throw new Error('环境配置检查失败!| Environment configuration check failed!');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function CheckConfError(hexo,msg) {
|
|
67
|
+
hexo.log.error(`
|
|
68
|
+
============================================================
|
|
69
|
+
配置文件检查失败!| Configuration check failed!
|
|
70
|
+
============================================================
|
|
71
|
+
${msg}
|
|
72
|
+
============================================================`);
|
|
73
|
+
throw new Error('配置文件检查失败!| Configuration check failed!');
|
|
74
|
+
}
|
|
@@ -15,6 +15,29 @@ function merge(target, source) {
|
|
|
15
15
|
return target;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// volantis_static_cdn
|
|
19
|
+
function volantis_static_cdn(source,hexo) {
|
|
20
|
+
for (const key in source) {
|
|
21
|
+
if (isObject(source[key])) {
|
|
22
|
+
volantis_static_cdn(source[key],hexo);
|
|
23
|
+
} else if(source[key] && typeof source[key] =="string") {
|
|
24
|
+
if(source[key].match(/^volantis-static\//g)){
|
|
25
|
+
source[key] = hexo.theme.config.volantis_static_cdn + source[key].replace(/^volantis-static\//g,"")
|
|
26
|
+
}
|
|
27
|
+
} else if(source[key] && Array.isArray(source[key]) && source[key].length>0) {
|
|
28
|
+
source[key].forEach((item,index)=>{
|
|
29
|
+
if(item && typeof item =="string") {
|
|
30
|
+
if(item.match(/^volantis-static\//g)){
|
|
31
|
+
source[key][index] = hexo.theme.config.volantis_static_cdn + item.replace(/^volantis-static\//g,"")
|
|
32
|
+
}
|
|
33
|
+
}else if (isObject(item)){
|
|
34
|
+
volantis_static_cdn(item,hexo);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
18
41
|
module.exports = hexo => {
|
|
19
42
|
if (!hexo.locals.get) return;
|
|
20
43
|
|
|
@@ -22,16 +45,17 @@ module.exports = hexo => {
|
|
|
22
45
|
if (!data) return;
|
|
23
46
|
|
|
24
47
|
/**
|
|
25
|
-
* Merge configs from _data/
|
|
26
|
-
* If `override`, configs in
|
|
27
|
-
* If
|
|
48
|
+
* Merge configs from _data/volantis.yml into hexo.theme.config.
|
|
49
|
+
* If `override`, configs in volantis.yml will rewrite configs in hexo.theme.config.
|
|
50
|
+
* If volantis.yml not exists, merge all `theme_config.*` into hexo.theme.config.
|
|
28
51
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
|
|
53
|
+
if (data.volantis) {
|
|
54
|
+
if (data.volantis.override) {
|
|
55
|
+
hexo.theme.config = data.volantis;
|
|
32
56
|
} else {
|
|
33
|
-
merge(hexo.config, data.
|
|
34
|
-
merge(hexo.theme.config, data.
|
|
57
|
+
merge(hexo.config, data.volantis);
|
|
58
|
+
merge(hexo.theme.config, data.volantis);
|
|
35
59
|
}
|
|
36
60
|
} else {
|
|
37
61
|
merge(hexo.theme.config, hexo.config.theme_config);
|
|
@@ -42,7 +66,7 @@ module.exports = hexo => {
|
|
|
42
66
|
hexo.config.relative_link = false;
|
|
43
67
|
}
|
|
44
68
|
hexo.config.meta_generator = false;
|
|
45
|
-
|
|
69
|
+
hexo.theme.config.getStartTime = Date.now();
|
|
46
70
|
// Custom languages support. Introduced in NexT v6.3.0.
|
|
47
71
|
if (data.languages) {
|
|
48
72
|
var { language } = hexo.config;
|
|
@@ -60,4 +84,5 @@ module.exports = hexo => {
|
|
|
60
84
|
mergeLang(language);
|
|
61
85
|
}
|
|
62
86
|
}
|
|
87
|
+
volantis_static_cdn(hexo.theme.config,hexo);
|
|
63
88
|
};
|