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/.eslintrc.json
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["eslint:recommended"],
|
|
3
|
-
"parserOptions": {
|
|
4
|
-
"ecmaVersion": 2020
|
|
5
|
-
},
|
|
6
|
-
"rules": {
|
|
7
|
-
"no-console": [2, {"allow": ["warn"]}],
|
|
8
|
-
"no-empty": [2, {"allowEmptyCatch": true}],
|
|
9
|
-
"no-unused-vars": [2, {"args": "none"}],
|
|
10
|
-
"no-extra-parens": [2, "all", {"conditionalAssign": false, "returnAssign": false, "nestedBinaryExpressions": false, "enforceForArrowConditionals": false}],
|
|
11
|
-
"array-callback-return": 2,
|
|
12
|
-
"block-scoped-var": 2,
|
|
13
|
-
"curly": [2, "multi-line"],
|
|
14
|
-
"dot-location": [2, "property"],
|
|
15
|
-
"dot-notation": 2,
|
|
16
|
-
"eqeqeq": [2, "smart"],
|
|
17
|
-
"no-else-return": 2,
|
|
18
|
-
"no-eval": 2,
|
|
19
|
-
"no-extend-native": 2,
|
|
20
|
-
"no-extra-bind": 2,
|
|
21
|
-
"no-extra-label": 2,
|
|
22
|
-
"no-implicit-globals": 2,
|
|
23
|
-
"no-implied-eval": 2,
|
|
24
|
-
"no-lone-blocks": 2,
|
|
25
|
-
"no-loop-func": 2,
|
|
26
|
-
"no-multi-spaces": [2, {"exceptions": {"ImportDeclaration": true, "VariableDeclarator": true, "FunctionDeclarator": true, "AssignmentExpression": true, "CallExpression": true}}],
|
|
27
|
-
"no-multi-str": 2,
|
|
28
|
-
"no-new": 2,
|
|
29
|
-
"no-new-func": 2,
|
|
30
|
-
"no-new-wrappers": 2,
|
|
31
|
-
"no-proto": 2,
|
|
32
|
-
"no-return-assign": 2,
|
|
33
|
-
"no-self-compare": 2,
|
|
34
|
-
"no-sequences": 2,
|
|
35
|
-
"no-throw-literal": 2,
|
|
36
|
-
"no-unused-expressions": [2, {"allowShortCircuit": true, "allowTernary": true}],
|
|
37
|
-
"no-useless-call": 2,
|
|
38
|
-
"no-useless-concat": 2,
|
|
39
|
-
"no-useless-return": 2,
|
|
40
|
-
"no-void": 2,
|
|
41
|
-
"no-with": 2,
|
|
42
|
-
"prefer-promise-reject-errors": 2,
|
|
43
|
-
"radix": 2,
|
|
44
|
-
"wrap-iife": [2, "inside"],
|
|
45
|
-
"yoda": 2,
|
|
46
|
-
"no-label-var": 2,
|
|
47
|
-
"no-shadow-restricted-names": 2,
|
|
48
|
-
"no-undef-init": 2,
|
|
49
|
-
"no-use-before-define": 2,
|
|
50
|
-
"array-bracket-spacing": 2,
|
|
51
|
-
"block-spacing": 2,
|
|
52
|
-
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
|
|
53
|
-
"comma-dangle": 2,
|
|
54
|
-
"comma-spacing": 2,
|
|
55
|
-
"comma-style": 2,
|
|
56
|
-
"computed-property-spacing": 2,
|
|
57
|
-
"eol-last": 2,
|
|
58
|
-
"func-call-spacing": 2,
|
|
59
|
-
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}],
|
|
60
|
-
"key-spacing": [2, {"align": "colon"}],
|
|
61
|
-
"keyword-spacing": 2,
|
|
62
|
-
"linebreak-style": 2,
|
|
63
|
-
"lines-around-comment": 2,
|
|
64
|
-
"new-cap": [2, {"capIsNew": false}],
|
|
65
|
-
"new-parens": 2,
|
|
66
|
-
"no-array-constructor": 2,
|
|
67
|
-
"no-mixed-operators": 2,
|
|
68
|
-
"no-multi-assign": 2,
|
|
69
|
-
"no-multiple-empty-lines": 2,
|
|
70
|
-
"no-nested-ternary": 2,
|
|
71
|
-
"no-new-object": 2,
|
|
72
|
-
"no-trailing-spaces": 2,
|
|
73
|
-
"no-unneeded-ternary": 2,
|
|
74
|
-
"no-whitespace-before-property": 2,
|
|
75
|
-
"one-var": [2, {"uninitialized": "always", "initialized": "never"}],
|
|
76
|
-
"operator-linebreak": [2, "before"],
|
|
77
|
-
"quotes": [2, "single"],
|
|
78
|
-
"semi": 2,
|
|
79
|
-
"semi-spacing": 2,
|
|
80
|
-
"space-before-blocks": 2,
|
|
81
|
-
"space-before-function-paren": [2, "never"],
|
|
82
|
-
"space-in-parens": 2,
|
|
83
|
-
"space-infix-ops": 2,
|
|
84
|
-
"space-unary-ops": 2,
|
|
85
|
-
"template-tag-spacing": 2,
|
|
86
|
-
"unicode-bom": 2,
|
|
87
|
-
"arrow-spacing": 2,
|
|
88
|
-
"generator-star-spacing": [2, "after"],
|
|
89
|
-
"no-confusing-arrow": [2, {"allowParens": true}],
|
|
90
|
-
"no-duplicate-imports": 2,
|
|
91
|
-
"no-useless-computed-key": 2,
|
|
92
|
-
"no-useless-constructor": 2,
|
|
93
|
-
"no-useless-rename": 2,
|
|
94
|
-
"prefer-const": 2,
|
|
95
|
-
"rest-spread-spacing": 2,
|
|
96
|
-
"template-curly-spacing": 2,
|
|
97
|
-
"yield-star-spacing": 2
|
|
98
|
-
},
|
|
99
|
-
"globals": {
|
|
100
|
-
"volantis": true,
|
|
101
|
-
"APlayerController": true,
|
|
102
|
-
"pdata": true
|
|
103
|
-
},
|
|
104
|
-
"env": {
|
|
105
|
-
"browser": true,
|
|
106
|
-
"jquery": true,
|
|
107
|
-
"mocha": true,
|
|
108
|
-
"node": true,
|
|
109
|
-
"es6": true
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<% if (theme.comments.service == 'valine'){ %>
|
|
2
|
-
<div class="new-meta-item comments-count">
|
|
3
|
-
<%
|
|
4
|
-
var path = post.path || page.path;
|
|
5
|
-
if (path.length > 9 && (path.substring(path.length - 10) == 'index.html')) {
|
|
6
|
-
path = path.substring(0, path.length - 10);
|
|
7
|
-
}
|
|
8
|
-
%>
|
|
9
|
-
<a href="<%- url_for(path) %>#comments">
|
|
10
|
-
<i class="<%- theme.article.body.meta_library.valinecount.icon %> fa-fw"></i>
|
|
11
|
-
<span class="valine-comment-count" data-xid="<%- url_for(path) %>">0</span>
|
|
12
|
-
<span class="leancloud-comments-count"> <%- theme.article.body.meta_library.valinecount.desc %></span>
|
|
13
|
-
</a>
|
|
14
|
-
</div>
|
|
15
|
-
<% } %>
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
<% if (theme.rightmenu.enable == true && theme.rightmenu.layout.length > 0) { %>
|
|
2
|
-
<% function loadmenu(obj) { %>
|
|
3
|
-
<li>
|
|
4
|
-
<a class='vlts-menu fix-cursor-default <%= obj.toggle == 'darkmode' ? 'toggle-mode-btn' : ''%>' <%= obj.url ? 'href='+ url_for(obj.url)+'' : ''%>
|
|
5
|
-
<% if (obj.rel) { %>
|
|
6
|
-
rel="<%- obj.rel %>"
|
|
7
|
-
<% } %>
|
|
8
|
-
<% if (obj.target) { %>
|
|
9
|
-
target="<%- obj.target %>"
|
|
10
|
-
<% } %>
|
|
11
|
-
<% if (obj.onclick) { %>
|
|
12
|
-
onclick="<%- obj.onclick %>"
|
|
13
|
-
<% } %>
|
|
14
|
-
<% if (obj.id) { %>
|
|
15
|
-
id="<%- obj.id %>"
|
|
16
|
-
<% } else if (obj.url) { %>
|
|
17
|
-
id="<%= url_for(obj.url).replace(/\/|%|\./g, "")?url_for(obj.url).replace(/\/|%|\./g, ""):"home" %>"
|
|
18
|
-
<% } %>>
|
|
19
|
-
<% if (obj.icon) { %><i class='<%= obj.icon %> fa-fw'></i><% } %> <%- obj.name %>
|
|
20
|
-
</a>
|
|
21
|
-
</li>
|
|
22
|
-
<% } %>
|
|
23
|
-
|
|
24
|
-
<div id="rightmenu-wrapper">
|
|
25
|
-
<ul class="list-v rightmenu" id="rightmenu-content">
|
|
26
|
-
<li class='option'>
|
|
27
|
-
<a class='vlts-menu opt fix-cursor-default' id='menu-copy-text' onclick="document.execCommand('copy')"><i class='fa fa-copy fa-fw'></i><%- __('rightmenu.copy_text') %></a>
|
|
28
|
-
<hr id='hr-text'>
|
|
29
|
-
<a class='vlts-menu opt fix-cursor-default' id='menu-copy-href'><i class='fa fa-link fa-fw'></i><%- __('rightmenu.copy_link') %></a>
|
|
30
|
-
<a class='vlts-menu opt fix-cursor-default' id='menu-open-href'><i class='fa fa-external-link-square-alt fa-fw'></i><%- __('rightmenu.open_in_new_tab') %></a>
|
|
31
|
-
<hr id='hr-href'>
|
|
32
|
-
<a class='vlts-menu opt fix-cursor-default' id='menu-copy-src'><i class='fa fa-image fa-fw'></i><%- __('rightmenu.copy_image_src') %></a>
|
|
33
|
-
<hr id='hr-src'>
|
|
34
|
-
</li>
|
|
35
|
-
<% if (theme.plugins.fontawesome) { %>
|
|
36
|
-
<li class='navigation'>
|
|
37
|
-
<a class='nav icon-only fix-cursor-default' onclick='history.back()'><i class='fa fa-arrow-left fa-fw'></i></a>
|
|
38
|
-
<a class='nav icon-only fix-cursor-default' onclick='history.forward()'><i class='fa fa-arrow-right fa-fw'></i></a>
|
|
39
|
-
<a class='nav icon-only fix-cursor-default' onclick='window.location.reload()'><i class='fa fa-redo fa-fw'></i></a>
|
|
40
|
-
<a class='nav icon-only fix-cursor-default' href='/'><i class='fa fa-home fa-fw'></i></a>
|
|
41
|
-
</li>
|
|
42
|
-
<% } else { %>
|
|
43
|
-
<li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='history.back()'><i class='fa fa-arrow-left fa-fw'></i><%- __('rightmenu.back') %></a></li>
|
|
44
|
-
<li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='history.forward()'><i class='fa fa-arrow-right fa-fw'></i><%- __('rightmenu.forward') %></a></li>
|
|
45
|
-
<li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='window.location.reload()'><i class='fa fa-redo fa-fw'></i><%- __('rightmenu.reload') %></a></li>
|
|
46
|
-
<% } %>
|
|
47
|
-
<hr>
|
|
48
|
-
<% theme.rightmenu.layout.forEach(function(item){ %>
|
|
49
|
-
<% if (item == 'hr') { %>
|
|
50
|
-
<hr>
|
|
51
|
-
<% } else if (item == 'music' && theme.plugins.aplayer.enable == true) { %>
|
|
52
|
-
<li class='music name'>
|
|
53
|
-
<p class='nav music-title fix-cursor-default'></p>
|
|
54
|
-
</li>
|
|
55
|
-
<li class='music ctrl'>
|
|
56
|
-
<a class='nav icon-only backward fix-cursor-default' onclick='aplayerBackward()'><i class='fa fa-step-backward fa-fw'></i></a>
|
|
57
|
-
<a class='nav icon-only toggle fix-cursor-default' onclick='aplayerToggle()'><i class='fa fa-play fa-fw'></i></a>
|
|
58
|
-
<a class='nav icon-only forward fix-cursor-default' onclick='aplayerForward()'><i class='fa fa-step-forward fa-fw'></i></a>
|
|
59
|
-
</li>
|
|
60
|
-
<li class='music volume'>
|
|
61
|
-
<a class='nav volume'>
|
|
62
|
-
<div class="aplayer-volume-bar-wrap">
|
|
63
|
-
<div class="aplayer-volume-bar fix-cursor-pointer">
|
|
64
|
-
<div class="aplayer-volume"></div>
|
|
65
|
-
<i class='left fa fa-volume-off fa-fw'></i>
|
|
66
|
-
<i class='right fa fa-volume-up fa-fw'></i>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</a>
|
|
70
|
-
</li>
|
|
71
|
-
<% } else if (item in theme.rightmenu) { %>
|
|
72
|
-
<% loadmenu(theme.rightmenu[item]) %>
|
|
73
|
-
<% } %>
|
|
74
|
-
<% }) %>
|
|
75
|
-
</ul>
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<script>
|
|
79
|
-
window.document.oncontextmenu = function (event) {
|
|
80
|
-
if (event.ctrlKey) return true;
|
|
81
|
-
if (/Android|webOS|BlackBerry/i.test(navigator.userAgent)) return true;
|
|
82
|
-
return popMenu(event);
|
|
83
|
-
};
|
|
84
|
-
document.addEventListener("click", function (event) {
|
|
85
|
-
var mymenu = document.getElementById('rightmenu-wrapper');
|
|
86
|
-
mymenu.style.display = "none";
|
|
87
|
-
});
|
|
88
|
-
function popMenu(event) {
|
|
89
|
-
var mymenu = document.getElementById('rightmenu-wrapper');
|
|
90
|
-
var menuContent = document.getElementById('rightmenu-content');
|
|
91
|
-
var screenWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
92
|
-
var screenHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
93
|
-
mymenu.style.left = event.clientX + "px"; // 获取鼠标位置
|
|
94
|
-
mymenu.style.top = event.clientY + "px";
|
|
95
|
-
mymenu.style.display = 'block';
|
|
96
|
-
if (event.clientX * 2 > screenWidth) {
|
|
97
|
-
menuContent.classList.add('left');
|
|
98
|
-
} else {
|
|
99
|
-
menuContent.classList.remove('left');
|
|
100
|
-
}
|
|
101
|
-
if (event.clientY * 2 > screenHeight) {
|
|
102
|
-
menuContent.classList.add('top');
|
|
103
|
-
} else {
|
|
104
|
-
menuContent.classList.remove('top');
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
let hrText = document.getElementById('hr-text');
|
|
108
|
-
let hrSrc = document.getElementById('hr-src');
|
|
109
|
-
let hrHref = document.getElementById('hr-href');
|
|
110
|
-
|
|
111
|
-
// 选中图片
|
|
112
|
-
let copySrc = document.getElementById('menu-copy-src');
|
|
113
|
-
if (copySrc != undefined) {
|
|
114
|
-
if (event.target.currentSrc) {
|
|
115
|
-
copySrc.style.display = 'block';
|
|
116
|
-
copySrc.addEventListener("click", function (e) {
|
|
117
|
-
copyString(event.target.currentSrc);
|
|
118
|
-
},{once: true});
|
|
119
|
-
hrSrc.style.display = 'block';
|
|
120
|
-
} else {
|
|
121
|
-
copySrc.style.display = 'none';
|
|
122
|
-
hrSrc.style.display = 'none';
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// 选中按钮
|
|
127
|
-
// 判断是不是按钮
|
|
128
|
-
let href = '';
|
|
129
|
-
if (event.path) {
|
|
130
|
-
for (i = 0; i < event.path.length; i++) {
|
|
131
|
-
if (event.path[i].href != undefined && event.path[i].href.length > 0) {
|
|
132
|
-
href = event.path[i].href;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let copyText = document.getElementById('menu-copy-text');
|
|
138
|
-
copyText.style.display = 'none';
|
|
139
|
-
hrText.style.display = 'none';
|
|
140
|
-
if (href.length == 0) {
|
|
141
|
-
// 选中文本
|
|
142
|
-
if (window.getSelection().toString()) {
|
|
143
|
-
if ('<%= theme.plugins.clipboard.enable %>' == 'true') {
|
|
144
|
-
copyText.style.display = 'block';
|
|
145
|
-
hrText.style.display = 'block';
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// 在新标签页打开
|
|
151
|
-
let openHref = document.getElementById('menu-open-href');
|
|
152
|
-
if (openHref != undefined) {
|
|
153
|
-
if (href.length > 0) {
|
|
154
|
-
openHref.style.display = 'block';
|
|
155
|
-
openHref.addEventListener("click", function (e) {
|
|
156
|
-
window.open(href);
|
|
157
|
-
},{once: true});
|
|
158
|
-
hrHref.style.display = 'block';
|
|
159
|
-
} else {
|
|
160
|
-
openHref.style.display = 'none';
|
|
161
|
-
hrHref.style.display = 'none';
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
// 复制链接
|
|
165
|
-
let copyHref = document.getElementById('menu-copy-href');
|
|
166
|
-
if (copyHref != undefined) {
|
|
167
|
-
if (href.length > 0) {
|
|
168
|
-
copyHref.style.display = 'block';
|
|
169
|
-
copyHref.addEventListener("click", function (e) {
|
|
170
|
-
copyString(href);
|
|
171
|
-
},{once: true});
|
|
172
|
-
} else {
|
|
173
|
-
copyHref.style.display = 'none';
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// 有音乐播放器 see: layout/_third-party/aplayer/script.ejs
|
|
177
|
-
<% if (theme.plugins.aplayer.enable && (theme.rightmenu.layout||[]).includes('music')) { %>
|
|
178
|
-
if(volantis.APlayerLoaded){ // APlayer加载完成?
|
|
179
|
-
// 如果有aplayer,初始化一下
|
|
180
|
-
checkAPlayer();
|
|
181
|
-
}
|
|
182
|
-
<% } %>
|
|
183
|
-
return false; // 该行代码确保系统自带的右键菜单不会被调出
|
|
184
|
-
}
|
|
185
|
-
function hideMenu() {
|
|
186
|
-
document.getElementById('rightmenu-wrapper').style.display = 'none';
|
|
187
|
-
}
|
|
188
|
-
function copyString(str) {
|
|
189
|
-
const input = document.createElement('input');
|
|
190
|
-
input.setAttribute('readonly', 'readonly');
|
|
191
|
-
document.body.appendChild(input);
|
|
192
|
-
input.setAttribute('value', str);
|
|
193
|
-
input.select();
|
|
194
|
-
document.execCommand('copy');
|
|
195
|
-
document.body.removeChild(input);
|
|
196
|
-
}
|
|
197
|
-
document.execCommand('click');
|
|
198
|
-
</script>
|
|
199
|
-
<% } %>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<% if (theme.plugins.backstretch.enable && (theme.plugins.backstretch.images || page.images)) { %>
|
|
2
|
-
<% var imgs = theme.plugins.backstretch.images || page.images; %>
|
|
3
|
-
<% var posi = null;
|
|
4
|
-
if (theme.plugins.backstretch.position == 'cover') {
|
|
5
|
-
posi = '#cover-backstretch';
|
|
6
|
-
}
|
|
7
|
-
%>
|
|
8
|
-
<% if (imgs != undefined && theme.plugins.backstretch.position != undefined){ %>
|
|
9
|
-
<%- js(theme.plugins.backstretch.js) %>
|
|
10
|
-
<script type="text/javascript">
|
|
11
|
-
var imgs=<%- '["' + imgs.join('", "') + '"]' %>;
|
|
12
|
-
if ('<%- theme.plugins.backstretch.shuffle %>' == 'true') {
|
|
13
|
-
function shuffle(arr){
|
|
14
|
-
/*From countercurrent-time*/
|
|
15
|
-
var n = arr.length;
|
|
16
|
-
while(n--) {
|
|
17
|
-
var index = Math.floor(Math.random() * n);
|
|
18
|
-
var temp = arr[index];
|
|
19
|
-
arr[index] = arr[n];
|
|
20
|
-
arr[n] = temp;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
shuffle(imgs);
|
|
24
|
-
}
|
|
25
|
-
function Pjax_backstretch(){
|
|
26
|
-
<% if (posi) { %>
|
|
27
|
-
$('<%- posi %>').backstretch(
|
|
28
|
-
imgs,
|
|
29
|
-
{
|
|
30
|
-
duration: "<%- theme.plugins.backstretch.duration %>",
|
|
31
|
-
fade: "<%- theme.plugins.backstretch.fade %>"
|
|
32
|
-
});
|
|
33
|
-
<%} else { %>
|
|
34
|
-
$.backstretch(
|
|
35
|
-
imgs,
|
|
36
|
-
{
|
|
37
|
-
duration: "<%- theme.plugins.backstretch.duration %>",
|
|
38
|
-
fade: "<%- theme.plugins.backstretch.fade %>"
|
|
39
|
-
});
|
|
40
|
-
<%} %>
|
|
41
|
-
}
|
|
42
|
-
loadScript("<%- theme.plugins.backstretch.js %>",Pjax_backstretch)
|
|
43
|
-
</script>
|
|
44
|
-
<% } %>
|
|
45
|
-
<% } %>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
const rootElement = document.documentElement;
|
|
3
|
-
const darkModeStorageKey = "user-color-scheme";
|
|
4
|
-
const rootElementDarkModeAttributeName = "data-user-color-scheme";
|
|
5
|
-
|
|
6
|
-
const setLS = (k, v) => {
|
|
7
|
-
localStorage.setItem(k, v);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const removeLS = (k) => {
|
|
11
|
-
localStorage.removeItem(k);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const getLS = (k) => {
|
|
15
|
-
return localStorage.getItem(k);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const getModeFromCSSMediaQuery = () => {
|
|
19
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
20
|
-
? "dark"
|
|
21
|
-
: "light";
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const resetRootDarkModeAttributeAndLS = () => {
|
|
25
|
-
rootElement.removeAttribute(rootElementDarkModeAttributeName);
|
|
26
|
-
removeLS(darkModeStorageKey);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const validColorModeKeys = {
|
|
30
|
-
dark: true,
|
|
31
|
-
light: true,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const applyCustomDarkModeSettings = (mode) => {
|
|
35
|
-
const currentSetting = mode || getLS(darkModeStorageKey);
|
|
36
|
-
|
|
37
|
-
if (currentSetting === getModeFromCSSMediaQuery()) {
|
|
38
|
-
resetRootDarkModeAttributeAndLS();
|
|
39
|
-
} else if (validColorModeKeys[currentSetting]) {
|
|
40
|
-
rootElement.setAttribute(rootElementDarkModeAttributeName, currentSetting);
|
|
41
|
-
} else {
|
|
42
|
-
resetRootDarkModeAttributeAndLS();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const invertDarkModeObj = {
|
|
47
|
-
dark: "light",
|
|
48
|
-
light: "dark",
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* get target mode
|
|
53
|
-
*/
|
|
54
|
-
const toggleCustomDarkMode = () => {
|
|
55
|
-
let currentSetting = getLS(darkModeStorageKey);
|
|
56
|
-
|
|
57
|
-
if (validColorModeKeys[currentSetting]) {
|
|
58
|
-
currentSetting = invertDarkModeObj[currentSetting];
|
|
59
|
-
} else if (currentSetting === null) {
|
|
60
|
-
currentSetting = invertDarkModeObj[getModeFromCSSMediaQuery()];
|
|
61
|
-
} else {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
setLS(darkModeStorageKey, currentSetting);
|
|
65
|
-
return currentSetting;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* bind click event for toggle button
|
|
70
|
-
*/
|
|
71
|
-
var btn=$("#wrapper .toggle-mode-btn,#rightmenu-wrapper .toggle-mode-btn");
|
|
72
|
-
function bindToggleButton() {
|
|
73
|
-
btn.on('click',(e) => {
|
|
74
|
-
const mode = toggleCustomDarkMode();
|
|
75
|
-
applyCustomDarkModeSettings(mode);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
applyCustomDarkModeSettings();
|
|
80
|
-
document.addEventListener("DOMContentLoaded", bindToggleButton);
|
|
81
|
-
volantis.pjax.push(bindToggleButton);
|
|
82
|
-
volantis.pjax.send(()=>{
|
|
83
|
-
btn.unbind('click');
|
|
84
|
-
},'toggle-mode-btn-unbind');
|
|
85
|
-
</script>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
function loadIssuesJS() {
|
|
3
|
-
if ($(".md").find(".issues-api").length == 0) return;
|
|
4
|
-
<% if(theme.use_cdn) { %>
|
|
5
|
-
loadScript('https://cdn.jsdelivr.net/npm/hexo-theme-volantis@<%- theme.info.theme_version %>/source/js/issues.min.js');
|
|
6
|
-
<% } else { %>
|
|
7
|
-
loadScript('<%- url_for("/js/issues.js") %>');
|
|
8
|
-
<% } %>
|
|
9
|
-
};
|
|
10
|
-
$(function () {
|
|
11
|
-
loadIssuesJS();
|
|
12
|
-
});
|
|
13
|
-
volantis.pjax.push(()=>{
|
|
14
|
-
if (typeof IssuesAPI == "undefined") {
|
|
15
|
-
loadIssuesJS();
|
|
16
|
-
}
|
|
17
|
-
},"IssuesJS")
|
|
18
|
-
</script>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
const SearchServiceimagePath="https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@master/img/";
|
|
3
|
-
const ROOT = ("<%- config.root %>" || "/").endsWith('/') ? ("<%- config.root %>" || "/") : ("<%- config.root %>/" || "/" );
|
|
4
|
-
|
|
5
|
-
$('.input.u-search-input').one('focus',function(){
|
|
6
|
-
<% if (theme.search.js) { %>
|
|
7
|
-
loadScript('<%- theme.search.js %>',setSearchService);
|
|
8
|
-
<% } else if(theme.use_cdn) { %>
|
|
9
|
-
loadScript('<%- 'https://cdn.jsdelivr.net/npm/hexo-theme-volantis@'+theme.info.theme_version+'/source/js/search/'+theme.search.service+'.min.js' %>',setSearchService);
|
|
10
|
-
<% } else { %>
|
|
11
|
-
loadScript('<%- url_for('/js/search/'+theme.search.service+'.js') %>',setSearchService);
|
|
12
|
-
<% } %>
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
function listenSearch(){
|
|
16
|
-
<% if(theme.search.service === 'baidu') { %>
|
|
17
|
-
const BAIDU_API_ID = "<%- theme.search.baidu.apiId %>";
|
|
18
|
-
customSearch = new BaiduSearch({
|
|
19
|
-
apiId: BAIDU_API_ID,
|
|
20
|
-
imagePath: SearchServiceimagePath
|
|
21
|
-
});
|
|
22
|
-
<%} else if(theme.search.service === 'algolia') { %>
|
|
23
|
-
const ALGOLIA_API_KEY = "<%- theme.search.algolia.apiKey %>";
|
|
24
|
-
const ALGOLIA_APP_ID = "<%- theme.search.algolia.applicationID %>";
|
|
25
|
-
const ALGOLIA_INDEX_NAME = "<%- theme.search.algolia.indexName %>";
|
|
26
|
-
customSearch = new AlgoliaSearch({
|
|
27
|
-
apiKey: ALGOLIA_API_KEY,
|
|
28
|
-
appId: ALGOLIA_APP_ID,
|
|
29
|
-
indexName: ALGOLIA_INDEX_NAME,
|
|
30
|
-
imagePath: SearchServiceimagePath
|
|
31
|
-
});
|
|
32
|
-
<%} else if(theme.search.service === 'azure') { %>
|
|
33
|
-
const AZURE_QUERY_KEY = "<%- theme.search.azure.queryKey %>";
|
|
34
|
-
const AZURE_INDEX_NAME = "<%- theme.search.azure.indexName %>";
|
|
35
|
-
const AZURE_SERVICE_NAME = "<%- theme.search.azure.serviceName %>";
|
|
36
|
-
customSearch = new AzureSearch({
|
|
37
|
-
serviceName: AZURE_SERVICE_NAME,
|
|
38
|
-
indexName: AZURE_INDEX_NAME,
|
|
39
|
-
queryKey: AZURE_QUERY_KEY,
|
|
40
|
-
imagePath: SearchServiceimagePath
|
|
41
|
-
});
|
|
42
|
-
<%} else if(theme.search.service === 'google') { %>
|
|
43
|
-
const GOOGLE_CUSTOM_SEARCH_API_KEY = "<%- theme.search.google.apiKey %>";
|
|
44
|
-
const GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "<%- theme.search.google.engineId %>";
|
|
45
|
-
customSearch = new GoogleCustomSearch({
|
|
46
|
-
apiKey: GOOGLE_CUSTOM_SEARCH_API_KEY,
|
|
47
|
-
engineId: GOOGLE_CUSTOM_SEARCH_ENGINE_ID,
|
|
48
|
-
imagePath: SearchServiceimagePath
|
|
49
|
-
});
|
|
50
|
-
<%} else {%>
|
|
51
|
-
customSearch = new HexoSearch({
|
|
52
|
-
imagePath: SearchServiceimagePath
|
|
53
|
-
});
|
|
54
|
-
<%}%>
|
|
55
|
-
}
|
|
56
|
-
function setSearchService() {
|
|
57
|
-
listenSearch();
|
|
58
|
-
<% if(theme.cover.layout_scheme=='search'){%>
|
|
59
|
-
document.addEventListener("pjax:success", listenSearch);
|
|
60
|
-
<% } %>
|
|
61
|
-
}
|
|
62
|
-
</script>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<% let snackbar = site.data.notification[page.snackbar] %>
|
|
2
|
-
<div class='snackbar-wrap' theme='<%- snackbar.theme %>'>
|
|
3
|
-
<div class="snackbar-content">
|
|
4
|
-
<div class='title'><%- markdown(snackbar.title) %></div>
|
|
5
|
-
<div class='message'><%- markdown(snackbar.message) %></div>
|
|
6
|
-
<% if (snackbar.action && snackbar.action.length > 0) { %>
|
|
7
|
-
<div class="action">
|
|
8
|
-
<% snackbar.action.forEach((ac, i) => { %>
|
|
9
|
-
<% if (ac.dismiss) { %>
|
|
10
|
-
<a onclick="document.getElementsByClassName('snackbar-wrap')[0].style.display = 'none'">
|
|
11
|
-
<%- ac.title %>
|
|
12
|
-
</a>
|
|
13
|
-
<% } else { %>
|
|
14
|
-
<a href='<%- ac.url %>'>
|
|
15
|
-
<%- ac.title %>
|
|
16
|
-
</a>
|
|
17
|
-
<% } %>
|
|
18
|
-
<% }) %>
|
|
19
|
-
</div>
|
|
20
|
-
<% } %>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
let APlayerController = new Object();
|
|
3
|
-
APlayerController.id = '<%= theme.plugins.aplayer.id %>'; // 设定全局音乐播放ID
|
|
4
|
-
APlayerController.volume = '<%= theme.plugins.aplayer.volume %>';
|
|
5
|
-
loadCSS("https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css", window.volantis.loadcss);
|
|
6
|
-
// APlayer 需要在 MetingJS 之前加载
|
|
7
|
-
loadScript("<%- theme.plugins.aplayer.js.aplayer %>")
|
|
8
|
-
window.volantis.APlayerLoaded=0 // APlayer加载完成状态
|
|
9
|
-
var checkAPlayer = setInterval(function () {
|
|
10
|
-
if (!window.APlayer) return // APlayer加载完成?
|
|
11
|
-
if ($("#safearea").css("display")!="block") return // 文章内容加载完成? see: source/css/first.styl
|
|
12
|
-
clearInterval(checkAPlayer)
|
|
13
|
-
if (!window.volantis.APlayerLoaded&&!window.MetingJSElement){ // APlayer只能加载一次
|
|
14
|
-
window.volantis.APlayerLoaded=1 // APlayer加载完成
|
|
15
|
-
loadScript("<%- theme.plugins.aplayer.js.meting %>") // 加载 MetingJS
|
|
16
|
-
}
|
|
17
|
-
}, 2500) // 按照网速调节差分2.5s
|
|
18
|
-
// rightmenu see: layout/_partial/rightmenu.ejs
|
|
19
|
-
<% if (theme.rightmenu.enable && theme.rightmenu.layout.includes('music')) { %>
|
|
20
|
-
<% if(theme.use_cdn) { %>
|
|
21
|
-
loadScript('https://cdn.jsdelivr.net/npm/hexo-theme-volantis@<%- theme.info.theme_version %>/source/js/aplayer.min.js');
|
|
22
|
-
<% } else { %>
|
|
23
|
-
loadScript("<%- url_for("/js/aplayer.js") %>")
|
|
24
|
-
<% } %>
|
|
25
|
-
<% } %>
|
|
26
|
-
</script>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script src="<%- theme.plugins.clipboard.js %>"></script>
|
|
2
|
-
<script>
|
|
3
|
-
var clipboard = new ClipboardJS('.btn-copy', {
|
|
4
|
-
target: function (trigger) {
|
|
5
|
-
return trigger.nextElementSibling
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
function wait(callback, seconds) {
|
|
9
|
-
var timelag = null;
|
|
10
|
-
timelag = window.setTimeout(callback, seconds)
|
|
11
|
-
}
|
|
12
|
-
function pjax_initCopyCode() {
|
|
13
|
-
if($(".highlight .code pre").length+$(".article pre code").length==0)return;
|
|
14
|
-
var copyHtml = '';
|
|
15
|
-
copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
|
|
16
|
-
copyHtml += '<i class="fas fa-copy"></i><span>COPY</span>';
|
|
17
|
-
copyHtml += '</button>';
|
|
18
|
-
$(".highlight .code pre").before(copyHtml);
|
|
19
|
-
$(".article pre code").before(copyHtml);
|
|
20
|
-
clipboard.off('success').on('success', function (e) {
|
|
21
|
-
let $btn = $(e.trigger);
|
|
22
|
-
$btn.addClass('copied');
|
|
23
|
-
let $icon = $($btn.find('i'));
|
|
24
|
-
$icon.removeClass('fa-copy');
|
|
25
|
-
$icon.addClass('fa-check-circle');
|
|
26
|
-
let $span = $($btn.find('span'));
|
|
27
|
-
$span[0].innerText = 'COPIED';
|
|
28
|
-
wait(function () {
|
|
29
|
-
$icon.removeClass('fa-check-circle');
|
|
30
|
-
$icon.addClass('fa-copy');
|
|
31
|
-
$span[0].innerText = 'COPY'
|
|
32
|
-
}, 2000)
|
|
33
|
-
});
|
|
34
|
-
clipboard.off('error').on('error', function (e) {
|
|
35
|
-
e.clearSelection();
|
|
36
|
-
let $btn = $(e.trigger);
|
|
37
|
-
$btn.addClass('copy-failed');
|
|
38
|
-
let $icon = $($btn.find('i'));
|
|
39
|
-
$icon.removeClass('fa-copy');
|
|
40
|
-
$icon.addClass('fa-times-circle');
|
|
41
|
-
let $span = $($btn.find('span'));
|
|
42
|
-
$span[0].innerText = 'COPY FAILED';
|
|
43
|
-
wait(function () {
|
|
44
|
-
$icon.removeClass('fa-times-circle');
|
|
45
|
-
$icon.addClass('fa-copy');
|
|
46
|
-
$span[0].innerText = 'COPY'
|
|
47
|
-
}, 2000)
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
$(function () {
|
|
51
|
-
pjax_initCopyCode()
|
|
52
|
-
});
|
|
53
|
-
volantis.pjax.push(pjax_initCopyCode)
|
|
54
|
-
</script>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<div id="disqus_thread">
|
|
2
|
-
<div id="notShowDisqus" style="display: none;text-align: center;"><i class='fas fa-exclamation-triangle'></i> <%- __('post.comments_placeholder', 'Disqus') %></div>
|
|
3
|
-
<div id="load-btns"><a class="load-comments" onclick="needLoadDisqus()"><%- __('post.comments_load', 'Disqus') %></a></div>
|
|
4
|
-
<div id="loading-comments" style="display: none"><i class="fa fa-cog fa-spin fa-fw fa-2x"></i><br><%- __('post.comments_check', 'Disqus') %></div>
|
|
5
|
-
</div>
|