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
package/layout/_partial/head.ejs
CHANGED
|
@@ -1,129 +1,83 @@
|
|
|
1
1
|
<head hexo-theme='https://github.com/volantis-x/hexo-theme-volantis/tree/<%- theme.info.theme_version %>'>
|
|
2
|
+
<%- meta_generator() %>
|
|
3
|
+
<meta name="Volantis" content="<%- theme.info.theme_version %>">
|
|
2
4
|
<meta charset="utf-8">
|
|
3
5
|
<!-- SEO相关 -->
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<% } else if (theme.seo && theme.seo.robots) { %>
|
|
7
|
-
<% if (is_home()) { %>
|
|
8
|
-
<% if (page.prev == 0) { %>
|
|
9
|
-
<meta name="robots" content="<%- theme.seo.robots.home_first_page %>">
|
|
10
|
-
<% } else { %>
|
|
11
|
-
<meta name="robots" content="<%- theme.seo.robots.home_other_pages %>">
|
|
12
|
-
<% } %>
|
|
13
|
-
<% } else if (is_archive()) { %>
|
|
14
|
-
<meta name="robots" content="<%- theme.seo.robots.archive %>">
|
|
15
|
-
<% } else if (is_category()) { %>
|
|
16
|
-
<meta name="robots" content="<%- theme.seo.robots.category %>">
|
|
17
|
-
<% } else if (is_tag()) { %>
|
|
18
|
-
<meta name="robots" content="<%- theme.seo.robots.tag %>">
|
|
19
|
-
<% } %>
|
|
20
|
-
<% } %>
|
|
6
|
+
<%- generate_seo(theme, page) %>
|
|
7
|
+
<%- autoCanonical(config, page) %>
|
|
21
8
|
<!-- 渲染优化 -->
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
<%_ if (theme.dns_prefetch && theme.dns_prefetch.length){ _%>
|
|
10
|
+
<meta http-equiv='x-dns-prefetch-control' content='on' />
|
|
11
|
+
<%_ ([...theme.dns_prefetch]).forEach(function(item){ _%>
|
|
12
|
+
<link rel='dns-prefetch' href='<%- item %>'>
|
|
13
|
+
<link rel="preconnect" href="<%- item %>" crossorigin>
|
|
14
|
+
<%_ }) _%>
|
|
15
|
+
<%_ } _%>
|
|
25
16
|
<meta name="renderer" content="webkit">
|
|
26
17
|
<meta name="force-rendering" content="webkit">
|
|
27
18
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
19
|
+
<%_ if (theme.csp.enable) { _%>
|
|
20
|
+
<meta http-equiv="Content-Security-Policy" content="<%- theme.csp.content %>">
|
|
21
|
+
<%_ } _%>
|
|
28
22
|
<meta name="HandheldFriendly" content="True" >
|
|
29
23
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
30
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
|
|
25
|
+
<meta content="black-translucent" name="apple-mobile-web-app-status-bar-style">
|
|
26
|
+
<meta content="telephone=no" name="format-detection">
|
|
27
|
+
<!-- import head_begin begin -->
|
|
28
|
+
<%_ if (config.import && config.import.head_begin){ _%>
|
|
29
|
+
<%_ ([...config.import.head_begin]).forEach(function(item){ _%>
|
|
30
|
+
<%- item %>
|
|
31
|
+
<%_ }) _%>
|
|
32
|
+
<%_ } _%>
|
|
33
|
+
<!-- import head_begin end -->
|
|
34
|
+
<!-- Custom Files headBegin begin-->
|
|
35
|
+
<%- volantis_inject('headBegin') %>
|
|
36
|
+
<!-- Custom Files headBegin end-->
|
|
37
|
+
<%_ if (config.favicon) { _%>
|
|
38
|
+
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
|
|
39
|
+
<%_ } _%>
|
|
40
|
+
<link rel="preload" href="<%- theme.cdn.map.css.style %>" as="style">
|
|
41
|
+
<%- generate_preload_fontfamily(theme) %>
|
|
42
|
+
<!-- feed -->
|
|
43
|
+
<%_ if (config.feed && config.feed.path){ _%>
|
|
44
|
+
<%_ if (typeof(config.feed.path)=="string"){ _%>
|
|
45
|
+
<%- feed_tag(config.feed.path, {title: config.title}) %>
|
|
46
|
+
<%_ }else{ _%>
|
|
47
|
+
<%_ ([...config.feed.path]).forEach(function(item){ _%>
|
|
48
|
+
<%- feed_tag(item, {title: config.title}) %>
|
|
49
|
+
<%_ }) _%>
|
|
50
|
+
<%_ } _%>
|
|
51
|
+
<%_ } _%>
|
|
37
52
|
<!-- 页面元数据 -->
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} else if (is_home() && page.prev == 0) {
|
|
54
|
-
keywords = config.keywords || '';
|
|
55
|
-
description = config.description || '';
|
|
56
|
-
} else {
|
|
57
|
-
if ((page.layout == 'docs') && page.group && (page.group in theme.sidebar.widget_library)) {
|
|
58
|
-
let widget = theme.sidebar.widget_library[page.group];
|
|
59
|
-
if ((widget.class == 'group') && widget.seo_title) {
|
|
60
|
-
title = widget.seo_title + ": " + title;
|
|
61
|
-
}
|
|
53
|
+
<%- generate_title(config, theme, page) %>
|
|
54
|
+
<%- generate_keywords(config, theme, page) %>
|
|
55
|
+
<%- generate_description(config, theme, page) %>
|
|
56
|
+
<%- open_graph(theme.open_graph) %>
|
|
57
|
+
<style>
|
|
58
|
+
/* 首屏样式 */
|
|
59
|
+
<%- FirstCSS() %>
|
|
60
|
+
</style>
|
|
61
|
+
<link rel="stylesheet" href="<%- theme.cdn.map.css.style %>" media="print" onload="this.media='all';this.onload=null">
|
|
62
|
+
<noscript><link rel="stylesheet" href="<%- theme.cdn.map.css.style %>"></noscript>
|
|
63
|
+
<%_ if (theme.plugins.darkmode.enable) { _%>
|
|
64
|
+
<script>
|
|
65
|
+
let userColorScheme=localStorage.getItem("color-scheme")
|
|
66
|
+
if(userColorScheme){
|
|
67
|
+
document.documentElement.setAttribute("color-scheme", userColorScheme);
|
|
62
68
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (theme.seo && theme.seo.use_excerpt_as_description) {
|
|
73
|
-
if (page.description == undefined) {
|
|
74
|
-
if (page.excerpt) {
|
|
75
|
-
description = truncate(strip_html(page.excerpt), {length: 160});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
%>
|
|
80
|
-
<title><% if (title) { %><%= title %> - <% } %><%= config.title %></title>
|
|
81
|
-
<% if (keywords){ %>
|
|
82
|
-
<meta name="keywords" content="<%- keywords %>">
|
|
83
|
-
<% } %>
|
|
84
|
-
|
|
85
|
-
<% if (description){ %>
|
|
86
|
-
<meta name="description" content="<%- description %>">
|
|
87
|
-
<% } %>
|
|
88
|
-
|
|
89
|
-
<!-- feed -->
|
|
90
|
-
<% if (config.feed && config.feed.path){ %>
|
|
91
|
-
<%- feed_tag(config.feed.path, {title: config.title}) %>
|
|
92
|
-
<% } %>
|
|
93
|
-
|
|
94
|
-
<!-- import meta -->
|
|
95
|
-
<% if (config.import && config.import.meta){ %>
|
|
96
|
-
<% (config.import.meta||[]).forEach(function(item){ %>
|
|
69
|
+
</script>
|
|
70
|
+
<%_ } _%>
|
|
71
|
+
<%- partial('../_plugins/end-of-support/script') %>
|
|
72
|
+
<%- partial('scripts/global') %>
|
|
73
|
+
<!-- import head_end begin -->
|
|
74
|
+
<%_ if (config.import && config.import.head_end){ _%>
|
|
75
|
+
<%_ ([...config.import.head_end]).forEach(function(item){ _%>
|
|
97
76
|
<%- item %>
|
|
98
|
-
<% }) %>
|
|
99
|
-
<% } %>
|
|
100
|
-
|
|
101
|
-
<!--
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<% } %>
|
|
105
|
-
|
|
106
|
-
<!-- import link -->
|
|
107
|
-
<% if (config.import && config.import.link){ %>
|
|
108
|
-
<% (config.import.link||[]).forEach(function(item){ %>
|
|
109
|
-
<%- item %><% }) %>
|
|
110
|
-
<% } %>
|
|
111
|
-
|
|
112
|
-
<% if (theme.use_cdn && theme.info.cdn && theme.info.cdn.css.first) { %>
|
|
113
|
-
<%- css(theme.info.cdn.css.first) %>
|
|
114
|
-
<% } else { %>
|
|
115
|
-
<%- css('/css/first.css') %>
|
|
116
|
-
<% } %>
|
|
117
|
-
|
|
118
|
-
<% if (theme.use_cdn && theme.info.cdn && theme.info.cdn.css.style) { %>
|
|
119
|
-
<link rel="stylesheet" href="<%- theme.info.cdn.css.style %>" media="print" onload="this.media='all';this.onload=null">
|
|
120
|
-
<noscript><link rel="stylesheet" href="<%- theme.info.cdn.css.style %>"></noscript>
|
|
121
|
-
<% } else { %>
|
|
122
|
-
<link rel="stylesheet" href="<%- url_for("/css/style.css") %>" media="print" onload="this.media='all';this.onload=null">
|
|
123
|
-
<noscript><link rel="stylesheet" href="<%- url_for("/css/style.css") %>"></noscript>
|
|
124
|
-
<% } %>
|
|
125
|
-
|
|
126
|
-
<script id="loadcss"></script>
|
|
127
|
-
|
|
128
|
-
<%- partial('../_third-party/end-of-support/script') %>
|
|
77
|
+
<%_ }) _%>
|
|
78
|
+
<%_ } _%>
|
|
79
|
+
<!-- import head_end end -->
|
|
80
|
+
<!-- Custom Files headEnd begin-->
|
|
81
|
+
<%- volantis_inject('headEnd') %>
|
|
82
|
+
<!-- Custom Files headEnd end-->
|
|
129
83
|
</head>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
<%-
|
|
2
|
-
<header 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.pjax_cover.headerShow %>" <%- (theme.navbar.visiable == 'auto' && theme.cover.height_scheme) ? "style='opacity: 0'" : "" %> >
|
|
3
2
|
<div class='container'>
|
|
4
3
|
<div id='wrapper'>
|
|
5
4
|
<div class='nav-sub'>
|
|
6
5
|
<p class="title"></p>
|
|
7
6
|
<ul class='switcher nav-list-h m-phone' id="pjax-header-nav-list">
|
|
8
|
-
<li><a id="s-comment" class="
|
|
7
|
+
<li><a id="s-comment" class="fa-solid fa-comments fa-fw" target="_self" href="/" onclick="return false;" title="comment"></a></li>
|
|
9
8
|
<% if (page.sidebar == undefined || page.sidebar != false) { %>
|
|
10
|
-
<li><a id="s-toc" class="s-toc
|
|
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>
|
|
11
10
|
<% } %>
|
|
12
11
|
</ul>
|
|
13
12
|
</div>
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
<ul class="list-v">
|
|
51
50
|
<li>
|
|
52
51
|
<div class="aplayer-container">
|
|
53
|
-
<%- partial('../
|
|
52
|
+
<%- partial('../_plugins/aplayer/layout', {post: null, where: 'footer'}) %>
|
|
54
53
|
</div>
|
|
55
54
|
</li>
|
|
56
55
|
</ul>
|
|
@@ -62,7 +61,9 @@
|
|
|
62
61
|
</li>
|
|
63
62
|
<% } else { %>
|
|
64
63
|
<li>
|
|
65
|
-
<a class="menuitem flat-box faa-parent animated-hover"
|
|
64
|
+
<a class="menuitem flat-box faa-parent animated-hover"
|
|
65
|
+
<%- value.url ? `href="` + url_for(value.url) + `" title="` + (value.description || value.name) + `"`
|
|
66
|
+
: ` href="/" onclick="return false;" title="` + (value.description || value.name) + `"` %>
|
|
66
67
|
<% if (value.rel) { %>
|
|
67
68
|
rel="<%- value.rel %>"
|
|
68
69
|
<% } %>
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
target="<%- value.target %>"
|
|
71
72
|
<% } %>
|
|
72
73
|
<% if (value.url) { %>
|
|
73
|
-
|
|
74
|
+
active-action="action-<%= url_for(value.url).replace(/\/|%|\./g, "")?url_for(value.url).replace(/\/|%|\./g, ""):"home" %>"
|
|
74
75
|
<% } %>>
|
|
75
76
|
<% if (value.icon) { %><i class='<%= value.icon %> fa-fw'></i><% } %><%- value.name %>
|
|
76
77
|
</a>
|
|
@@ -89,20 +90,21 @@
|
|
|
89
90
|
<% }) %>
|
|
90
91
|
</ul>
|
|
91
92
|
</div>
|
|
92
|
-
|
|
93
|
+
<% if (theme.search.enable) { %>
|
|
93
94
|
<div class="m_search">
|
|
94
95
|
<form name="searchform" class="form u-search-form">
|
|
95
|
-
<i class="icon
|
|
96
|
+
<i class="icon fa-solid fa-search fa-fw"></i>
|
|
96
97
|
<input type="text" class="input u-search-input" placeholder="<%- theme.navbar && theme.navbar.search %>" />
|
|
97
98
|
</form>
|
|
98
99
|
</div>
|
|
100
|
+
<% } %>
|
|
99
101
|
|
|
100
102
|
<ul class='switcher nav-list-h m-phone'>
|
|
101
103
|
<% if (theme.search.enable === true) { %>
|
|
102
|
-
<li><a class="s-search
|
|
104
|
+
<li><a class="s-search fa-solid fa-search fa-fw" target="_self" href="/" onclick="return false;" title="search"></a></li>
|
|
103
105
|
<% } %>
|
|
104
106
|
<li>
|
|
105
|
-
<a class="s-menu
|
|
107
|
+
<a class="s-menu fa-solid fa-bars fa-fw" target="_self" href="/" onclick="return false;" title="menu"></a>
|
|
106
108
|
<ul class="menu-phone list-v navigation white-box">
|
|
107
109
|
<% menu_list.forEach(function(value){ %>
|
|
108
110
|
<% menu(value, 'mobile') %>
|
|
@@ -110,6 +112,10 @@
|
|
|
110
112
|
</ul>
|
|
111
113
|
</li>
|
|
112
114
|
</ul>
|
|
115
|
+
|
|
116
|
+
<!-- Custom Files header begin -->
|
|
117
|
+
<%- volantis_inject('header') %>
|
|
118
|
+
<!-- Custom Files header end -->
|
|
113
119
|
</div>
|
|
114
120
|
</div>
|
|
115
121
|
</div>
|
package/layout/_partial/meta.ejs
CHANGED
|
@@ -13,21 +13,25 @@ if (post.bottom_meta == false) {
|
|
|
13
13
|
<% if (post.headimg) { %>
|
|
14
14
|
<div class='headimg-div'>
|
|
15
15
|
<a class='headimg-a'>
|
|
16
|
-
<img class='headimg' src='<%- post.headimg %>'/>
|
|
16
|
+
<img itemprop="image" class='headimg' src='<%- post.headimg %>'/>
|
|
17
17
|
</a>
|
|
18
18
|
</div>
|
|
19
|
+
<% } else { %>
|
|
20
|
+
<span hidden>
|
|
21
|
+
<meta itemprop="image" content="<%- theme.structured_data.data.logo.path %>">
|
|
22
|
+
</span>
|
|
19
23
|
<% } %>
|
|
20
24
|
<div class="article-meta" id="top">
|
|
21
25
|
<% if (post.music && post.music.enable != false) { %>
|
|
22
|
-
<%- partial('../
|
|
26
|
+
<%- partial('../_plugins/aplayer/layout', {post: post, where: 'meta'}) %>
|
|
23
27
|
<% } %>
|
|
24
28
|
<% if (post.thumbnail && post.thumbnail.length){ %>
|
|
25
29
|
<a title='<%- post.title %>' href='<%- url_for(post.link || post.path) %>'>
|
|
26
|
-
<img class='thumbnail' src='<%- post.thumbnail %>'>
|
|
30
|
+
<img itemprop="image" class='thumbnail' src='<%- post.thumbnail %>'>
|
|
27
31
|
</a>
|
|
28
32
|
<% } %>
|
|
29
33
|
<% if (post.title) { %>
|
|
30
|
-
<h1 class="title">
|
|
34
|
+
<h1 class="title" itemprop="name headline">
|
|
31
35
|
<%- post.title %>
|
|
32
36
|
</h1>
|
|
33
37
|
<div class='new-meta-box'>
|
|
@@ -36,7 +40,14 @@ if (post.bottom_meta == false) {
|
|
|
36
40
|
<%- partial('../_meta/' + meta, {post: post}) %>
|
|
37
41
|
<% } %>
|
|
38
42
|
<% }) %>
|
|
43
|
+
<!-- Custom Files topMeta begin-->
|
|
44
|
+
<%- volantis_inject('topMeta') %>
|
|
45
|
+
<!-- Custom Files topMeta end-->
|
|
39
46
|
</div>
|
|
47
|
+
<% } else { %>
|
|
48
|
+
<span hidden itemprop="name headline">
|
|
49
|
+
<%- post.title %>
|
|
50
|
+
</span>
|
|
40
51
|
<% } %>
|
|
41
52
|
</div>
|
|
42
53
|
<% } else if (position == 'bottom') { %>
|
|
@@ -48,5 +59,8 @@ if (post.bottom_meta == false) {
|
|
|
48
59
|
<% } %>
|
|
49
60
|
<% }) %>
|
|
50
61
|
</div>
|
|
62
|
+
<!-- Custom Files bottomMeta begin -->
|
|
63
|
+
<%- volantis_inject('bottomMeta') %>
|
|
64
|
+
<!-- Custom Files bottomMeta end -->
|
|
51
65
|
</div>
|
|
52
66
|
<% } %>
|
package/layout/_partial/post.ejs
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
<div class="post post-v3 white-box reveal <%- theme.custom_css.body.effect.join(' ') %>">
|
|
1
|
+
<div class="post post-v3 white-box reveal <%- theme.custom_css.body.effect.join(' ') %>" itemscope itemtype="http://schema.org/Article" >
|
|
2
|
+
<link itemprop="mainEntityOfPage" href="<%- post.permalink %>">
|
|
3
|
+
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
|
|
4
|
+
<meta itemprop="name" content="<%- config.title %>">
|
|
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 %>">
|
|
9
|
+
</span>
|
|
2
10
|
<%
|
|
3
11
|
let showPin = false;
|
|
4
12
|
if (post.pin && (post.title || theme.article.preview.auto_title) && theme.article.preview.pin_icon) {
|
|
@@ -19,15 +27,19 @@
|
|
|
19
27
|
%>
|
|
20
28
|
<% if (showPin == true) { %>
|
|
21
29
|
<div class='pin'>
|
|
22
|
-
<img src='<%- theme.article.preview.pin_icon %>'/>
|
|
30
|
+
<img alt="<%- post.title %>" src='<%- theme.article.preview.pin_icon %>'/>
|
|
23
31
|
</div>
|
|
24
32
|
<% } %>
|
|
25
33
|
<% if (post.headimg) { %>
|
|
26
34
|
<div class='headimg-div'>
|
|
27
35
|
<a class='headimg-a' href="<%- url_for(post.link || post.path) %>">
|
|
28
|
-
<img class='headimg' src='<%- post.headimg %>'/>
|
|
36
|
+
<img itemprop="image" class='headimg' alt="<%- post.title %>" src='<%- post.headimg %>'/>
|
|
29
37
|
</a>
|
|
30
38
|
</div>
|
|
39
|
+
<% } else { %>
|
|
40
|
+
<span hidden>
|
|
41
|
+
<meta itemprop="image" content="<%- theme.structured_data.data.logo.path %>">
|
|
42
|
+
</span>
|
|
31
43
|
<% } %>
|
|
32
44
|
<% if (showTitle) { %>
|
|
33
45
|
<%
|
|
@@ -36,13 +48,17 @@
|
|
|
36
48
|
pinTitle = true;
|
|
37
49
|
}
|
|
38
50
|
%>
|
|
39
|
-
<h2 class="article-title" <%- pinTitle ? 'pin' : ''
|
|
40
|
-
<a href="<%- url_for(post.link || post.path) %>">
|
|
51
|
+
<h2 class="article-title" <%- pinTitle ? 'pin' : '' %> itemprop="name headline">
|
|
52
|
+
<a href="<%- url_for(post.link || post.path) %>" itemprop="url">
|
|
41
53
|
<%- (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, theme.article.body.meta_library.date.format) %>
|
|
42
54
|
</a>
|
|
43
55
|
</h2>
|
|
56
|
+
<% } else { %>
|
|
57
|
+
<span hidden itemprop="name headline">
|
|
58
|
+
<%- (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, theme.article.body.meta_library.date.format) %>
|
|
59
|
+
</span>
|
|
44
60
|
<% } %>
|
|
45
|
-
<div class='md'>
|
|
61
|
+
<div class='md article-desc' itemprop="articleBody">
|
|
46
62
|
<% if (post.excerpt) { %>
|
|
47
63
|
<%- post.excerpt %>
|
|
48
64
|
<% } else if (post.description) { %>
|
|
@@ -50,7 +66,7 @@
|
|
|
50
66
|
<% } else if (post.content) { %>
|
|
51
67
|
<% if (theme.article.preview.auto_excerpt) { %>
|
|
52
68
|
<%- truncate(strip_html(post.content), {length: 200}) %>
|
|
53
|
-
<% } else { %>
|
|
69
|
+
<% } else if(!theme.article.preview.hide_excerpt) { %>
|
|
54
70
|
<%- post.content %>
|
|
55
71
|
<% } %>
|
|
56
72
|
<% } %>
|
|
@@ -67,8 +83,13 @@
|
|
|
67
83
|
}
|
|
68
84
|
%>
|
|
69
85
|
<a class='avatar' href='<%- author.url %>'><img src='<%- author.avatar %>'></a>
|
|
86
|
+
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
|
|
87
|
+
<meta itemprop="image" content="<%- author.avatar %>">
|
|
88
|
+
<meta itemprop="name" content="<%- author.name %>">
|
|
89
|
+
<meta itemprop="url" content="<%- author.url %>">
|
|
90
|
+
</span>
|
|
70
91
|
<% } %>
|
|
71
|
-
<time><%= date(post.date, config.date_format) %></time>
|
|
92
|
+
<time itemprop="dateCreated datePublished" datetime="<%- moment(post.date).format() %>"><%= date(post.date, config.date_format) %></time>
|
|
72
93
|
<% if (post.categories && post.categories.length > 0) { %>
|
|
73
94
|
<span class="dot"></span>
|
|
74
95
|
<%- list_categories(post.categories, {
|
|
@@ -76,11 +97,16 @@
|
|
|
76
97
|
separator: '<span class="sep"></span>',
|
|
77
98
|
style: 'none'
|
|
78
99
|
}) %>
|
|
100
|
+
<% for(cat of post.categories.toArray()){ %>
|
|
101
|
+
<span hidden itemprop="about" itemscope itemtype="http://schema.org/Thing">
|
|
102
|
+
<a href="<%- url_for(cat.path) %>" itemprop="url"><span itemprop="name"><%- cat.name %></span></a>
|
|
103
|
+
</span>
|
|
104
|
+
<% } %>
|
|
79
105
|
<% } %>
|
|
80
106
|
</div>
|
|
81
107
|
<% if (showReadmore) { %>
|
|
82
108
|
<div>
|
|
83
|
-
<a class='readmore' href='<%- url_for(post.link || post.path) %>'>
|
|
109
|
+
<a class='readmore' href='<%- url_for(post.link || post.path) %>' itemprop="url">
|
|
84
110
|
<%- post.link ? __('post.readoriginal') : __('post.readmore') %>
|
|
85
111
|
</a>
|
|
86
112
|
</div>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<%_
|
|
2
|
+
// 这里存放全局 CDN 资源控制变量 此处是硬编码
|
|
3
|
+
// theme.cdn.addJS("search","search/"+theme.search.service,theme.search.js) => theme.cdn.map.js.search
|
|
4
|
+
// theme.cdn.addCSS("first","first",theme.cdn.set.css.first) => theme.cdn.map.css.first
|
|
5
|
+
|
|
6
|
+
theme.cdnCtrl={}
|
|
7
|
+
theme.cdnCtrl.cdn_version = "";
|
|
8
|
+
if (theme.cdn_version) {
|
|
9
|
+
theme.cdnCtrl.cdn_version = '?time=' + theme.getStartTime;
|
|
10
|
+
}
|
|
11
|
+
if (theme.cdn.enable&&theme.cdn.prefix) {
|
|
12
|
+
theme.cdnCtrl.prefix=theme.cdn.prefix.replace(/\/$/g, "")
|
|
13
|
+
} else {
|
|
14
|
+
theme.cdnCtrl.prefix="https://unpkg.com/hexo-theme-volantis@"+ theme.info.theme_version +"/source"
|
|
15
|
+
}
|
|
16
|
+
theme.cdn.map={}
|
|
17
|
+
theme.cdn.map.js={}
|
|
18
|
+
theme.cdn.map.css={}
|
|
19
|
+
theme.cdn.addJS=(name,source,force)=>{
|
|
20
|
+
if(force){
|
|
21
|
+
if (force.startsWith("/")) {
|
|
22
|
+
theme.cdn.map.js[name] = revisioned(force)
|
|
23
|
+
}else{
|
|
24
|
+
theme.cdn.map.js[name] = force + theme.cdnCtrl.cdn_version
|
|
25
|
+
}
|
|
26
|
+
}else{
|
|
27
|
+
if(!source){
|
|
28
|
+
source=name
|
|
29
|
+
}
|
|
30
|
+
source = source.replace(/^\//g, "")
|
|
31
|
+
if (theme.cdn.enable) {
|
|
32
|
+
let suffix=theme.cdn.prefix&&theme.cdn.prefix.match(/jsdelivr/g)?'.min.js':'.js'
|
|
33
|
+
source= (suffix==".min.js")?source.replace(/\.min/g, ""):source
|
|
34
|
+
theme.cdn.map.js[name]=theme.cdnCtrl.prefix + '/js/' + source + suffix + theme.cdnCtrl.cdn_version
|
|
35
|
+
} else {
|
|
36
|
+
theme.cdn.map.js[name]=url_for(revisioned('/js/'+ source + '.js'))
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return theme.cdn.map.js[name]
|
|
40
|
+
}
|
|
41
|
+
theme.cdn.addCSS=(name,source,force)=>{
|
|
42
|
+
if(force){
|
|
43
|
+
if (force.startsWith("/")) {
|
|
44
|
+
theme.cdn.map.css[name]= revisioned(force)
|
|
45
|
+
}else{
|
|
46
|
+
theme.cdn.map.css[name]= force + theme.cdnCtrl.cdn_version
|
|
47
|
+
}
|
|
48
|
+
}else{
|
|
49
|
+
if(!source){
|
|
50
|
+
source=name
|
|
51
|
+
}
|
|
52
|
+
source = source.replace(/^\//g, "")
|
|
53
|
+
if (theme.cdn.enable&&theme.cdn.prefix) {
|
|
54
|
+
let suffix=theme.cdn.prefix.match(/jsdelivr/g)?'.min.css':'.css'
|
|
55
|
+
source= (suffix==".min.js")?source.replace(/\.min/g, ""):source
|
|
56
|
+
theme.cdn.map.css[name]=theme.cdnCtrl.prefix + '/css/' + source + suffix + theme.cdnCtrl.cdn_version
|
|
57
|
+
} else {
|
|
58
|
+
theme.cdn.map.css[name]=url_for(revisioned('/css/'+ source + '.css'))
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return theme.cdn.map.css[name]
|
|
62
|
+
}
|
|
63
|
+
dfs = (n,path) => {
|
|
64
|
+
for (const key in n) {
|
|
65
|
+
const element = n[key];
|
|
66
|
+
if(element && typeof element !="string"){
|
|
67
|
+
dfs(element,path.concat(key))
|
|
68
|
+
}else{
|
|
69
|
+
let op=path.concat(key)
|
|
70
|
+
let source=""
|
|
71
|
+
for (let index = 1; index < op.length; index++) {
|
|
72
|
+
const element = op[index];
|
|
73
|
+
source+=element
|
|
74
|
+
if (index!=op.length-1) {
|
|
75
|
+
source+="/"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if(op[0]=="js"){
|
|
79
|
+
theme.cdn.addJS(op[op.length-1],source,element)
|
|
80
|
+
}
|
|
81
|
+
if(op[0]=="css"){
|
|
82
|
+
theme.cdn.addCSS(op[op.length-1],source,element)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
// 默认配置
|
|
90
|
+
theme.cdn.addCSS("style")
|
|
91
|
+
|
|
92
|
+
theme.cdn.addJS("app")
|
|
93
|
+
theme.cdn.addJS("parallax", "plugins/parallax")
|
|
94
|
+
theme.cdn.addJS("rightMenu", "plugins/rightMenu")
|
|
95
|
+
theme.cdn.addJS("rightMenus", "plugins/rightMenus")
|
|
96
|
+
theme.cdn.addJS("sites","plugins/tags/sites")
|
|
97
|
+
theme.cdn.addJS("friends","plugins/tags/friends")
|
|
98
|
+
theme.cdn.addJS("contributors","plugins/tags/contributors")
|
|
99
|
+
theme.cdn.addJS("search","search/"+theme.search.service,theme.search.js)
|
|
100
|
+
|
|
101
|
+
// 以下用于配置项 cdn.set 覆盖配置,下面是覆盖配置的方法
|
|
102
|
+
// cdn:
|
|
103
|
+
// enable: true
|
|
104
|
+
// # 以下配置可以覆盖 cdn.prefix,配置项的值可以为空,但是要使用CDN必须依据路径填写配置项的键
|
|
105
|
+
// set:
|
|
106
|
+
// js:
|
|
107
|
+
// app: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/app.js
|
|
108
|
+
// rightMenu: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/rightMenu.js
|
|
109
|
+
// parallax: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/parallax.js
|
|
110
|
+
// plugins:
|
|
111
|
+
// contributors: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/plugins/contributors.js
|
|
112
|
+
// friends: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/plugins/friends.js
|
|
113
|
+
// sites: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/js/plugins/sites.js
|
|
114
|
+
// css:
|
|
115
|
+
// style: https://cdn.jsdelivr.net/gh/volantis-x/volantis-x.github.io@gh-page/css/style.css
|
|
116
|
+
//
|
|
117
|
+
// 更新:
|
|
118
|
+
// 在部署时加入了 ?time=' + Date.now()
|
|
119
|
+
// 使用 js(theme.cdn.map.js.app) 引入的地址会形如: /js/app.js?time=1232123123.js
|
|
120
|
+
// 但是无伤大雅
|
|
121
|
+
// 更新:
|
|
122
|
+
// ?time=' + Date.now() 替换为 theme.getStartTime 保证相同资源 hash 不变
|
|
123
|
+
// 更新:
|
|
124
|
+
// 本地文件使用文件内容的hash值作为版本号 app.8c1e7c88.js see: /scripts/helpers/revisioned.js
|
|
125
|
+
dfs(theme.cdn.set,[])
|
|
126
|
+
_%>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<%_
|
|
2
2
|
// 为保证初次进入页面流畅,要求开启pjax且浏览器禁用Javascript时(仅HTML渲染)封面控制正常
|
|
3
|
+
// layout/_plugins/pjax/pdata.ejs
|
|
4
|
+
// layout/_partial/cover.ejs
|
|
5
|
+
// layout/_partial/header.ejs
|
|
3
6
|
theme.pjax_cover={}
|
|
4
7
|
theme.pjax_cover.enableCover = false; // 封面是否开启
|
|
5
8
|
theme.pjax_cover.frontMatterCover = 'none'; // 封面控制
|
|
6
9
|
theme.pjax_cover.coverWrapperDisplay = 'none';
|
|
7
|
-
theme.pjax_cover.coverWrapperID = 'full';
|
|
8
10
|
theme.pjax_cover.scrollDownDisplay = 'none';
|
|
9
11
|
theme.pjax_cover.headerShow = 'show';
|
|
10
12
|
if(theme.cover && theme.cover.height_scheme) {
|
|
@@ -22,30 +24,20 @@
|
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
/*cover*/
|
|
25
|
-
if (theme.pjax_cover.frontMatterCover == "
|
|
27
|
+
if (theme.pjax_cover.frontMatterCover == "full") {
|
|
28
|
+
theme.pjax_cover.coverWrapperDisplay= "";
|
|
29
|
+
theme.pjax_cover.scrollDownDisplay = "";
|
|
30
|
+
} else if (theme.pjax_cover.frontMatterCover == "half"){
|
|
31
|
+
theme.pjax_cover.coverWrapperDisplay= "";
|
|
32
|
+
theme.pjax_cover.scrollDownDisplay = "none";
|
|
33
|
+
} else if (theme.pjax_cover.frontMatterCover == "none"){
|
|
26
34
|
theme.pjax_cover.coverWrapperDisplay= "none";
|
|
27
|
-
} else {
|
|
28
|
-
if (theme.pjax_cover.frontMatterCover == "half") { // 半屏
|
|
29
|
-
theme.pjax_cover.coverWrapperID= 'half';
|
|
30
35
|
theme.pjax_cover.scrollDownDisplay = "none";
|
|
31
|
-
} else if (theme.pjax_cover.frontMatterCover == "full") { // 全屏
|
|
32
|
-
theme.pjax_cover.coverWrapperID= 'full';
|
|
33
|
-
theme.pjax_cover.scrollDownDisplay = "";
|
|
34
|
-
}
|
|
35
|
-
theme.pjax_cover.coverWrapperDisplay = "";
|
|
36
36
|
}
|
|
37
37
|
/*header*/
|
|
38
|
-
if (theme.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}else{
|
|
45
|
-
if(theme.cover.height_scheme){
|
|
46
|
-
theme.pjax_cover.headerShow="";
|
|
47
|
-
}else{
|
|
48
|
-
theme.pjax_cover.headerShow="show";
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
%>
|
|
38
|
+
if (theme.pjax_cover.frontMatterCover == "none") {
|
|
39
|
+
theme.pjax_cover.headerShow="show";
|
|
40
|
+
} else {
|
|
41
|
+
theme.pjax_cover.headerShow="";
|
|
42
|
+
}
|
|
43
|
+
_%>
|