hexo-theme-volantis 4.2.0 → 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 +7 -5
- package/_config.yml +651 -234
- 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 -2
- package/layout/_meta/author.ejs +4 -4
- package/layout/_meta/category.ejs +11 -8
- package/layout/_meta/counter.ejs +51 -2
- 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/{valinecount.ejs → walinecount.ejs} +16 -15
- 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 -13
- package/layout/_partial/categories.ejs +1 -1
- package/layout/_partial/cover.ejs +10 -30
- package/layout/_partial/footer.ejs +19 -11
- package/layout/_partial/head.ejs +70 -110
- 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} +22 -26
- 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 +423 -0
- package/layout/_partial/scripts/index.ejs +89 -73
- 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/_plugins/analytics/script.ejs +74 -0
- 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/_plugins/end-of-support/script.ejs +62 -0
- 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/_plugins/nodewaves/script.ejs +12 -0
- package/layout/_plugins/parallax/script.ejs +74 -0
- package/layout/{_third-party → _plugins}/pjax/animate.ejs +31 -26
- package/layout/_plugins/pjax/index.ejs +73 -0
- package/layout/_plugins/pjax/pdata.ejs +56 -0
- package/layout/_plugins/preload/script.ejs +14 -0
- 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 +40 -24
- 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 +6 -2
- 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 +35 -10
- 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 +1 -1
- package/scripts/filters/replace.js +15 -0
- package/scripts/{z-lazyload/lib/process.js → filters/z-lazyload.js} +18 -15
- 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} +9 -9
- 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 +31 -26
- package/scripts/tags/btns.js +18 -13
- package/scripts/tags/checkbox.js +32 -22
- package/scripts/tags/contributors.js +100 -0
- package/scripts/tags/dropmenu.js +50 -35
- package/scripts/tags/fancybox.js +44 -10
- package/scripts/tags/folding.js +14 -9
- package/scripts/tags/frame.js +8 -3
- package/scripts/tags/friends.js +99 -0
- package/scripts/tags/ghcard.js +11 -6
- package/scripts/tags/image.js +18 -6
- package/scripts/tags/link.js +15 -10
- package/scripts/tags/md.js +59 -0
- package/scripts/tags/media.js +32 -8
- package/scripts/tags/note.js +41 -8
- package/scripts/tags/site.js +87 -51
- package/scripts/tags/span.js +16 -6
- package/scripts/tags/swiper.js +38 -0
- package/scripts/tags/table.js +1 -1
- package/scripts/tags/tabs.js +33 -3
- package/scripts/tags/timeline.js +9 -4
- 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 +20 -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 +2 -1
- 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 +11 -0
- 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 +1128 -359
- 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 -378
- package/layout/_partial/rightmenu.ejs +0 -204
- package/layout/_partial/scripts/cover.ejs +0 -45
- package/layout/_partial/scripts/darkmode.ejs +0 -96
- package/layout/_partial/scripts/import.ejs +0 -3
- package/layout/_partial/scripts/loadfunction.ejs +0 -72
- package/layout/_partial/scripts/search.ejs +0 -62
- package/layout/_partial/snackbar.ejs +0 -22
- package/layout/_third-party/analytics/script.ejs +0 -24
- package/layout/_third-party/aplayer/script.ejs +0 -24
- package/layout/_third-party/clipboard/script.ejs +0 -53
- package/layout/_third-party/comments/disqus/layout.ejs +0 -5
- package/layout/_third-party/comments/disqus/script.ejs +0 -93
- package/layout/_third-party/comments/gitalk/layout.ejs +0 -1
- package/layout/_third-party/comments/gitalk/script.ejs +0 -29
- 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 -29
- package/layout/_third-party/comments/twikoo/layout.ejs +0 -3
- package/layout/_third-party/comments/twikoo/script.ejs +0 -17
- package/layout/_third-party/comments/valine/layout.ejs +0 -3
- package/layout/_third-party/comments/valine/script.ejs +0 -75
- package/layout/_third-party/comments/vssue/layout.ejs +0 -1
- package/layout/_third-party/comments/vssue/script.ejs +0 -22
- package/layout/_third-party/fancybox/script.ejs +0 -50
- package/layout/_third-party/issues/script.ejs +0 -15
- package/layout/_third-party/pjax/index.ejs +0 -143
- package/layout/_third-party/pjax/pdata.ejs +0 -47
- package/layout/_third-party/scrollreveal/script.ejs +0 -15
- package/layout/artitalk.ejs +0 -48
- 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 -16
- package/source/css/_plugins/valine.styl +0 -173
- 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 -161
- package/source/js/issues.js +0 -186
- package/source/js/search/algolia.js +0 -348
- package/source/js/search/azure.js +0 -359
- package/source/js/search/baidu.js +0 -342
- package/source/js/search/google.js +0 -343
- package/source/js/twikoo.js +0 -13
- package/source/js/valine.js +0 -5265
|
@@ -1,128 +1,144 @@
|
|
|
1
|
-
|
|
1
|
+
<script>
|
|
2
|
+
/******************** volantis.dom ********************************/
|
|
3
|
+
// 页面选择器 将dom对象缓存起来 see: /source/js/app.js etc.
|
|
4
|
+
volantis.dom.bodyAnchor = volantis.dom.$(document.getElementById("safearea")); // 页面主体
|
|
5
|
+
volantis.dom.topBtn = volantis.dom.$(document.getElementById('s-top')); // 向上
|
|
6
|
+
volantis.dom.wrapper = volantis.dom.$(document.getElementById('wrapper')); // 整个导航栏
|
|
7
|
+
volantis.dom.coverAnchor = volantis.dom.$(document.querySelector('#l_cover .cover-wrapper')); // 1个
|
|
8
|
+
volantis.dom.switcher = volantis.dom.$(document.querySelector('#l_header .switcher .s-search')); // 搜索按钮 移动端 1个
|
|
9
|
+
volantis.dom.header = volantis.dom.$(document.getElementById('l_header')); // 移动端导航栏
|
|
10
|
+
volantis.dom.search = volantis.dom.$(document.querySelector('#l_header .m_search')); // 搜索框 桌面端 移动端 1个
|
|
11
|
+
volantis.dom.mPhoneList = volantis.dom.$(document.querySelectorAll('#l_header .m-phone .list-v')); // 手机端 子菜单 多个
|
|
12
|
+
</script>
|
|
13
|
+
|
|
2
14
|
<script>
|
|
3
15
|
<% if (theme.plugins.fontawesome) { %>
|
|
4
|
-
|
|
16
|
+
volantis.css("<%- theme.plugins.fontawesome %>");
|
|
5
17
|
<% } %>
|
|
6
18
|
<% if (theme.plugins.fontawesome_animation.enable) { %>
|
|
7
|
-
|
|
19
|
+
volantis.css("<%- theme.plugins.fontawesome_animation.css %>");
|
|
8
20
|
<% } %>
|
|
9
21
|
<% if (theme.plugins.nodewaves.enable) { %>
|
|
10
|
-
|
|
11
|
-
<% } %>
|
|
12
|
-
<% if ((theme.plugins.highlightjs.enable == true)&&(theme.plugins.highlightjs.css)) { %>
|
|
13
|
-
loadCSS("<%- theme.plugins.highlightjs.css %>", window.volantis.loadcss);
|
|
22
|
+
volantis.css("<%- theme.plugins.nodewaves.css %>");
|
|
14
23
|
<% } %>
|
|
15
24
|
</script>
|
|
25
|
+
|
|
16
26
|
<!-- required -->
|
|
17
|
-
|
|
18
|
-
<%-
|
|
27
|
+
<% if (theme.plugins.globalJquery) { %>
|
|
28
|
+
<%- js(theme.plugins.jquery) %>
|
|
29
|
+
<% } %>
|
|
19
30
|
|
|
20
31
|
<!-- internal -->
|
|
21
|
-
<%-
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
<%- js(theme.cdn.map.js.app) %>
|
|
33
|
+
|
|
34
|
+
<% if (theme.rightmenu.enable) { %>
|
|
35
|
+
<%- partial('../../_plugins/rightmenu/layout') %>
|
|
24
36
|
<% } %>
|
|
25
37
|
|
|
26
|
-
<% if (theme.
|
|
27
|
-
<%- partial('../../
|
|
38
|
+
<% if (theme.rightmenus.enable) { %>
|
|
39
|
+
<%- partial('../../_plugins/rightmenus/layout') %>
|
|
28
40
|
<% } %>
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
<!-- rightmenu要在darkmode之前(ToggleButton) darkmode要在comments之前(volantis.dark.push)-->
|
|
43
|
+
<% if (theme.plugins.darkmode.enable) { %>
|
|
44
|
+
<%- partial('../../_plugins/darkmode/script') %>
|
|
32
45
|
<% } %>
|
|
33
46
|
|
|
34
|
-
<% if (theme.plugins.
|
|
35
|
-
|
|
36
|
-
<% if (preload.service == 'instant_page') { %>
|
|
37
|
-
<script async src="<%- preload.instant_page %>" type="module" defer integrity="sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1"></script>
|
|
38
|
-
<% } else if (preload.service == 'flying_pages') { %>
|
|
39
|
-
<script>
|
|
40
|
-
window.FPConfig = {
|
|
41
|
-
delay: 0,
|
|
42
|
-
ignoreKeywords: [],
|
|
43
|
-
maxRPS: 5,
|
|
44
|
-
hoverDelay: 25
|
|
45
|
-
};
|
|
46
|
-
</script>
|
|
47
|
-
<script defer src="<%- preload.flying_pages %>"></script>
|
|
48
|
-
<% } %>
|
|
47
|
+
<% if (theme.plugins.sitesjs.enable || theme.plugins.friendsjs.enable || theme.plugins.contributorsjs.enable) { %>
|
|
48
|
+
<%- partial('../../_plugins/github-api/script') %>
|
|
49
49
|
<% } %>
|
|
50
50
|
|
|
51
|
+
<% if (theme.plugins.lazyload && theme.plugins.lazyload.enable) { %>
|
|
52
|
+
<%- partial('../../_plugins/lazyload/script') %>
|
|
53
|
+
<% } %>
|
|
51
54
|
|
|
52
|
-
<% if (theme.plugins.
|
|
53
|
-
<%- partial('../../
|
|
55
|
+
<% if (theme.plugins.preload.enable && theme.plugins.preload.service) { %>
|
|
56
|
+
<%- partial('../../_plugins/preload/script') %>
|
|
54
57
|
<% } %>
|
|
55
58
|
|
|
56
59
|
<% if (theme.plugins.scrollreveal.enable && theme.plugins.scrollreveal.js) { %>
|
|
57
|
-
<%- partial('../../
|
|
60
|
+
<%- partial('../../_plugins/scrollreveal/script') %>
|
|
58
61
|
<% } %>
|
|
59
62
|
|
|
60
63
|
<% if (theme.plugins.aplayer && theme.plugins.aplayer.enable && theme.plugins.aplayer.js) { %>
|
|
61
|
-
<%- partial('../../
|
|
62
|
-
<% } %>
|
|
64
|
+
<%- partial('../../_plugins/aplayer/script') %>
|
|
65
|
+
<% } %>
|
|
66
|
+
|
|
67
|
+
<%
|
|
68
|
+
if (theme.comments.service && theme.comments.service.length > 0) {
|
|
69
|
+
try { %>
|
|
70
|
+
<%- partial('../../_plugins/comments/' + theme.comments.service + '/script') %>
|
|
71
|
+
<% } catch (e) {
|
|
72
|
+
// error friendly
|
|
73
|
+
console.log(`
|
|
74
|
+
===============================================================================
|
|
75
|
+
没有找到评论插件:${theme.comments.service}
|
|
76
|
+
请检查是否存在该插件,或者检查插件名称是否正确:${theme.comments.service}
|
|
77
|
+
see: https://volantis.js.org/v5/theme-settings/#选择评论系统
|
|
78
|
+
================================================================================
|
|
79
|
+
There is no comments plugin: ${theme.comments.service}
|
|
80
|
+
Please check if the plugin exists, or check the plugin name is correct: ${theme.comments.service}
|
|
81
|
+
see: https://volantis.js.org/v5/theme-settings/#选择评论系统
|
|
82
|
+
=================================================================================`)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
%>
|
|
86
|
+
|
|
63
87
|
|
|
64
|
-
<% if (theme.comments.service && theme.comments.service.length > 0) { %>
|
|
65
|
-
<%- partial('../../_third-party/comments/' + theme.comments.service + '/script') %>
|
|
66
|
-
<% } %>
|
|
67
88
|
|
|
68
89
|
<% if (theme.analytics.busuanzi) { %>
|
|
69
90
|
<script defer src="<%- theme.analytics.busuanzi %>" data-pjax></script>
|
|
70
91
|
<% } %>
|
|
71
|
-
<% if (theme.use_cdn && theme.info.cdn && theme.info.cdn.js) { %>
|
|
72
|
-
<%- js(theme.info.cdn.js) %>
|
|
73
|
-
<% } else if(theme.use_cdn) { %>
|
|
74
|
-
<%- js(['https://cdn.jsdelivr.net/npm/hexo-theme-volantis@'+theme.info.theme_version+'/source/js/app.min.js']) %>
|
|
75
|
-
<% } else { %>
|
|
76
|
-
<%- js(['js/app.js']) %>
|
|
77
|
-
<% } %>
|
|
78
92
|
|
|
79
93
|
<!-- optional -->
|
|
80
94
|
<% if (theme.search && theme.search.enable) { %>
|
|
81
|
-
<%- partial('search') %>
|
|
95
|
+
<%- partial('../../_plugins/search/script') %>
|
|
82
96
|
<% } %>
|
|
83
97
|
|
|
84
|
-
|
|
85
98
|
<% if (theme.plugins.nodewaves.enable) { %>
|
|
86
|
-
<%-
|
|
87
|
-
<script type="text/javascript">
|
|
88
|
-
$(function () {
|
|
89
|
-
Waves.attach('.flat-btn', ['waves-button']);
|
|
90
|
-
Waves.attach('.float-btn', ['waves-button', 'waves-float']);
|
|
91
|
-
Waves.attach('.float-btn-light', ['waves-button', 'waves-float', 'waves-light']);
|
|
92
|
-
Waves.attach('.flat-box', ['waves-block']);
|
|
93
|
-
Waves.attach('.float-box', ['waves-block', 'waves-float']);
|
|
94
|
-
Waves.attach('.waves-image');
|
|
95
|
-
Waves.init();
|
|
96
|
-
});
|
|
97
|
-
</script>
|
|
99
|
+
<%- partial('../../_plugins/nodewaves/script') %>
|
|
98
100
|
<% } %>
|
|
99
101
|
|
|
100
102
|
<% if (theme.plugins.comment_typing.enable) { %>
|
|
101
103
|
<%- js(theme.plugins.comment_typing.js) %>
|
|
102
104
|
<% } %>
|
|
103
105
|
|
|
104
|
-
<% if (theme.plugins.
|
|
105
|
-
|
|
106
|
-
<%- js(theme.plugins.highlightjs.js) %>
|
|
107
|
-
<script>hljs.initHighlightingOnLoad();</script>
|
|
108
|
-
<% } %>
|
|
106
|
+
<% if (theme.plugins.code_highlight) { %>
|
|
107
|
+
<%- partial('../../_plugins/highlight/script') %>
|
|
109
108
|
<% } %>
|
|
110
109
|
|
|
111
110
|
<% if (theme.analytics && theme.analytics.leancloud && theme.analytics.leancloud.app_id) { %>
|
|
112
|
-
<%- partial('
|
|
111
|
+
<%- partial('../../_plugins/analytics/LCCounter') %>
|
|
113
112
|
<% } %>
|
|
114
113
|
|
|
115
|
-
<% if (
|
|
116
|
-
<%- partial('
|
|
114
|
+
<% if (config.google_analytics_key || config.baidu_analytics_key || config.tencent_aegis_id || config.v6_51_la) { %>
|
|
115
|
+
<%- partial('../../_plugins/analytics/script') %>
|
|
117
116
|
<% } %>
|
|
118
117
|
|
|
119
|
-
|
|
118
|
+
<% if (theme.plugins.chat_service) { %>
|
|
119
|
+
<%- partial('../../_plugins/chat/index') %>
|
|
120
|
+
<% } %>
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
<% if (theme.plugins.parallax.enable) { %>
|
|
123
|
+
<%- partial('../../_plugins/parallax/script') %>
|
|
124
|
+
<% } %>
|
|
125
|
+
|
|
126
|
+
<% if (theme.plugins.swiper.enable) { %>
|
|
127
|
+
<%- partial('../../_plugins/swiper/script') %>
|
|
128
|
+
<% } %>
|
|
122
129
|
|
|
123
|
-
<!--
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
<!-- pjax 标签必须存在于所有页面 否则 pjax error -->
|
|
131
|
+
<pjax>
|
|
132
|
+
<% if (page.plugins) { %>
|
|
133
|
+
<%- partial('../../_plugins/_page_plugins/index') %>
|
|
126
134
|
<% } %>
|
|
135
|
+
</pjax>
|
|
127
136
|
|
|
137
|
+
<%- partial('toc') %>
|
|
138
|
+
|
|
139
|
+
<%- partial('content-visibility-scroll-fix') %>
|
|
140
|
+
|
|
141
|
+
<% if (theme.structured_data && theme.structured_data.enable) { %>
|
|
142
|
+
<%- structured_data() %>
|
|
143
|
+
<% } %>
|
|
128
144
|
|
|
@@ -1,80 +1,110 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
function listennSidebarTOC() {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
function listennSidebarTOC() {
|
|
3
|
+
const navItems = document.querySelectorAll(".toc li");
|
|
4
|
+
if (!navItems.length) return;
|
|
5
|
+
let targets = []
|
|
6
|
+
const sections = [...navItems].map((element) => {
|
|
7
|
+
const link = element.querySelector(".toc-link");
|
|
8
|
+
const target = document.getElementById(
|
|
9
|
+
decodeURI(link.getAttribute("href")).replace("#", "")
|
|
10
|
+
);
|
|
11
|
+
targets.push(target)
|
|
12
|
+
// 解除 a 标签 href 的 锚点定位, a 标签 href 的 锚点定位 会随机启用?? 产生错位???
|
|
13
|
+
link.setAttribute("onclick","return false;")
|
|
14
|
+
link.setAttribute("toc-action","toc-"+decodeURI(link.getAttribute("href")).replace("#", ""))
|
|
15
|
+
link.setAttribute("href","/")
|
|
16
|
+
// 配置 点击 触发新的锚点定位
|
|
17
|
+
link.addEventListener("click", (event) => {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
// 这里的 addTop 是通过错位使得 toc 自动展开.
|
|
20
|
+
volantis.scroll.to(target,{addTop: 5, observer:true})
|
|
21
|
+
// Anchor id
|
|
22
|
+
history.pushState(null, document.title, "#" + target.id);
|
|
23
|
+
});
|
|
24
|
+
return target;
|
|
18
25
|
});
|
|
19
|
-
return target;
|
|
20
|
-
});
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
function activateNavByIndex(target) {
|
|
28
|
+
if (target.classList.contains("active-current")) return;
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function findIndex(entries) {
|
|
37
|
-
let index = 0;
|
|
38
|
-
let entry = entries[index];
|
|
39
|
-
if (entry.boundingClientRect.top > 0) {
|
|
40
|
-
index = sections.indexOf(entry.target);
|
|
41
|
-
return index === 0 ? 0 : index - 1;
|
|
42
|
-
}
|
|
43
|
-
for (; index < entries.length; index++) {
|
|
44
|
-
if (entries[index].boundingClientRect.top <= 0) {
|
|
45
|
-
entry = entries[index];
|
|
46
|
-
} else {
|
|
47
|
-
return sections.indexOf(entry.target);
|
|
30
|
+
document.querySelectorAll(".toc .active").forEach((element) => {
|
|
31
|
+
element.classList.remove("active", "active-current");
|
|
32
|
+
});
|
|
33
|
+
target.classList.add("active", "active-current");
|
|
34
|
+
let parent = target.parentNode;
|
|
35
|
+
while (!parent.matches(".toc")) {
|
|
36
|
+
if (parent.matches("li")) parent.classList.add("active");
|
|
37
|
+
parent = parent.parentNode;
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
|
-
return sections.indexOf(entry.target);
|
|
51
|
-
}
|
|
52
40
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
// 方案一:
|
|
42
|
+
volantis.activateNavIndex=0
|
|
43
|
+
activateNavByIndex(navItems[volantis.activateNavIndex])
|
|
44
|
+
volantis.scroll.push(()=>{
|
|
45
|
+
if (targets[0].getBoundingClientRect().top >= 0) {
|
|
46
|
+
volantis.activateNavIndex = 0
|
|
47
|
+
}else if (targets[targets.length-1].getBoundingClientRect().top < 0) {
|
|
48
|
+
volantis.activateNavIndex = targets.length-1
|
|
49
|
+
} else {
|
|
50
|
+
for (let index = 0; index < targets.length; index++) {
|
|
51
|
+
const target0 = targets[index];
|
|
52
|
+
const target1 = targets[(index+1)%targets.length];
|
|
53
|
+
if (target0.getBoundingClientRect().top < 0&&target1.getBoundingClientRect().top >= 0) {
|
|
54
|
+
volantis.activateNavIndex=index
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
62
57
|
}
|
|
63
|
-
let index = findIndex(entries);
|
|
64
|
-
activateNavByIndex(navItems[index]);
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
rootMargin: marginTop + "px 0px -100% 0px",
|
|
68
|
-
threshold: 0,
|
|
69
58
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
activateNavByIndex(navItems[volantis.activateNavIndex])
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
// 方案二:
|
|
63
|
+
// IntersectionObserver 不是完美精确到像素级别 也不是低延时性的
|
|
64
|
+
// function findIndex(entries) {
|
|
65
|
+
// let index = 0;
|
|
66
|
+
// let entry = entries[index];
|
|
67
|
+
// if (entry.boundingClientRect.top > 0) {
|
|
68
|
+
// index = sections.indexOf(entry.target);
|
|
69
|
+
// return index === 0 ? 0 : index - 1;
|
|
70
|
+
// }
|
|
71
|
+
// for (; index < entries.length; index++) {
|
|
72
|
+
// if (entries[index].boundingClientRect.top <= 0) {
|
|
73
|
+
// entry = entries[index];
|
|
74
|
+
// } else {
|
|
75
|
+
// return sections.indexOf(entry.target);
|
|
76
|
+
// }
|
|
77
|
+
// }
|
|
78
|
+
// return sections.indexOf(entry.target);
|
|
79
|
+
// }
|
|
80
|
+
// function createIntersectionObserver(marginTop) {
|
|
81
|
+
// marginTop = Math.floor(marginTop + 10000);
|
|
82
|
+
// let intersectionObserver = new IntersectionObserver(
|
|
83
|
+
// (entries, observe) => {
|
|
84
|
+
// let scrollHeight = document.documentElement.scrollHeight;
|
|
85
|
+
// if (scrollHeight > marginTop) {
|
|
86
|
+
// observe.disconnect();
|
|
87
|
+
// createIntersectionObserver(scrollHeight);
|
|
88
|
+
// return;
|
|
89
|
+
// }
|
|
90
|
+
// let index = findIndex(entries);
|
|
91
|
+
// activateNavByIndex(navItems[index]);
|
|
92
|
+
// }, {
|
|
93
|
+
// rootMargin: marginTop + "px 0px -100% 0px",
|
|
94
|
+
// threshold: 0,
|
|
95
|
+
// }
|
|
96
|
+
// );
|
|
97
|
+
// sections.forEach((element) => {
|
|
98
|
+
// element && intersectionObserver.observe(element);
|
|
99
|
+
// });
|
|
100
|
+
// }
|
|
101
|
+
// createIntersectionObserver(document.documentElement.scrollHeight);
|
|
74
102
|
}
|
|
75
|
-
createIntersectionObserver(document.documentElement.scrollHeight);
|
|
76
|
-
}
|
|
77
103
|
|
|
78
|
-
document.addEventListener("DOMContentLoaded",
|
|
79
|
-
|
|
104
|
+
document.addEventListener("DOMContentLoaded", ()=>{
|
|
105
|
+
volantis.requestAnimationFrame(listennSidebarTOC)
|
|
106
|
+
});
|
|
107
|
+
document.addEventListener("pjax:success", ()=>{
|
|
108
|
+
volantis.requestAnimationFrame(listennSidebarTOC)
|
|
109
|
+
});
|
|
80
110
|
</script>
|
package/layout/_partial/side.ejs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
<aside
|
|
1
|
+
<aside id='l_side' itemscope itemtype="http://schema.org/WPSideBar">
|
|
2
2
|
<%- partial('../_widget/load', {widgets: page.sidebar, where: 'sidebar'}) %>
|
|
3
|
+
<!-- Custom Files side begin -->
|
|
4
|
+
<%- volantis_inject('side') %>
|
|
5
|
+
<!-- Custom Files side end -->
|
|
3
6
|
</aside>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("page-plugins",`<div id="artitalk_main"></div>`,{pjax:false}) // 外层有 pjax 标签
|
|
3
|
+
</script>
|
|
4
|
+
<script>
|
|
5
|
+
volantis.import.jQuery().then(()=>{
|
|
6
|
+
volantis.js("<%= theme.plugins.artitalk.js %>").then(()=>{
|
|
7
|
+
new Artitalk(Object.assign(<%- JSON.stringify(theme.plugins.artitalk) %>, {}))
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
<style>
|
|
12
|
+
#artitalk_main #lazy {
|
|
13
|
+
background: transparent !important;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("page-plugins",`<div id="bbtalk"></div>`,{pjax:false}) // 外层有 pjax 标签
|
|
3
|
+
</script>
|
|
4
|
+
<script>
|
|
5
|
+
volantis.import.jQuery().then(()=>{
|
|
6
|
+
volantis.js("<%= theme.plugins.bbtalk.js %>").then(()=>{
|
|
7
|
+
bbtalk.init(Object.assign(<%- JSON.stringify(theme.plugins.bbtalk) %>, {}))
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("page-plugins",`<div class="post-content"><div id="cf-container"><%- theme.plugins.fcircle.message %></div></div>`,{pjax:false}) // 外层有 pjax 标签
|
|
3
|
+
</script>
|
|
4
|
+
<script type="text/javascript">
|
|
5
|
+
var fdataUser = {
|
|
6
|
+
apiurl: '<%- theme.plugins.fcircle.api %>'
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
<link rel="stylesheet" href="<%- theme.plugins.fcircle.css %>">
|
|
10
|
+
<script type="text/javascript"
|
|
11
|
+
src="<%- theme.plugins.fcircle.js %>">
|
|
12
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%- partial( "../../chat/gitter/script") %>
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
// 这里是 page plugin
|
|
5
|
+
volantis.removeGitter=()=>{
|
|
6
|
+
document.querySelectorAll(".gitter-chat-embed").forEach(e=>{
|
|
7
|
+
e.remove()
|
|
8
|
+
})
|
|
9
|
+
document.querySelectorAll(".gitter-open-chat-button").forEach(e=>{
|
|
10
|
+
e.remove()
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
volantis.pjax.send(volantis.removeGitter)
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
#post-body p {
|
|
3
|
+
text-indent: 2em;
|
|
4
|
+
}
|
|
5
|
+
#post-body .new-meta-box p,
|
|
6
|
+
#post-body .note p,
|
|
7
|
+
#post-body .prev-next p,
|
|
8
|
+
#post-body .tag p,
|
|
9
|
+
#post-body blockquote p,
|
|
10
|
+
#post-body details p,
|
|
11
|
+
#post-body p.p,
|
|
12
|
+
#post-body .tab-pane .checkbox
|
|
13
|
+
#post-body section p {
|
|
14
|
+
text-indent: initial;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<%_
|
|
2
|
+
(page.plugins||[]).forEach(function(item){
|
|
3
|
+
try {
|
|
4
|
+
if (typeof item == "string") { _%>
|
|
5
|
+
<%- partial( item + "/index") %>
|
|
6
|
+
<%_ }else if(typeof item == "object"){ _%>
|
|
7
|
+
<%- partial( Object.keys(item)[0] + "/index", { pagePlugin:item }) %>
|
|
8
|
+
<%_ }
|
|
9
|
+
} catch (error) {
|
|
10
|
+
// error friendly
|
|
11
|
+
console.log(`
|
|
12
|
+
===============================================================================
|
|
13
|
+
没有找到页面插件:${item}
|
|
14
|
+
请检查是否存在该插件,或者检查插件名称是否正确:${item}
|
|
15
|
+
出问题的页面:${page.path}
|
|
16
|
+
see: https://volantis.js.org/v5/page-settings/#页面插件-page-plugins
|
|
17
|
+
================================================================================
|
|
18
|
+
There is no page plugin: ${item}
|
|
19
|
+
Please check if the plugin exists, or check the plugin name is correct: ${item}
|
|
20
|
+
The page that has problem: ${page.path}
|
|
21
|
+
see: https://volantis.js.org/v5/page-settings/#页面插件-page-plugins
|
|
22
|
+
=================================================================================`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
_%>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// https://www.micdz.cn/article/katex-on-volantis/
|
|
3
|
+
if (typeof renderMathInElement == "undefined") {
|
|
4
|
+
volantis.css("<%= theme.plugins.katex.css %>")
|
|
5
|
+
function pjax_katex() {
|
|
6
|
+
volantis.js("<%= theme.plugins.katex.render %>").then(()=>{
|
|
7
|
+
renderMathInElement(document.body);
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
volantis.js("<%= theme.plugins.katex.js %>").then(pjax_katex)
|
|
11
|
+
volantis.pjax.push(pjax_katex)
|
|
12
|
+
}
|
|
13
|
+
</script>
|
package/layout/{_third-party/math/mathjax/script.ejs → _plugins/_page_plugins/mathjax/index.ejs}
RENAMED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
};
|
|
39
39
|
(function () {
|
|
40
40
|
var script = document.createElement('script');
|
|
41
|
-
script.src =
|
|
41
|
+
script.src = "<%= theme.plugins.mathjax %>";
|
|
42
42
|
script.defer = true;
|
|
43
43
|
document.head.appendChild(script);
|
|
44
44
|
})();
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
// 文章章节标题不能为 “MathJax” ,否则会报错。
|
|
47
47
|
MathJax.startup.document.state(0);
|
|
48
48
|
MathJax.texReset();
|
|
49
|
-
MathJax.
|
|
49
|
+
MathJax.typesetPromise();
|
|
50
50
|
}
|
|
51
51
|
</script>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<% if (site.data.notification && (pagePlugin.snackbar in site.data.notification)) { %>
|
|
2
|
+
<% let snackbar = site.data.notification[pagePlugin.snackbar] %>
|
|
3
|
+
<% if (snackbar.position == 'bottom') { %>
|
|
4
|
+
<div id="snackbar"></div>
|
|
5
|
+
<script>
|
|
6
|
+
function Snackbar(){
|
|
7
|
+
document.getElementById("snackbar").innerHTML=`<div class='snackbar-wrap' theme='<%- snackbar.theme %>'>
|
|
8
|
+
<div class="snackbar-content">
|
|
9
|
+
<div class='title'><%- markdown(snackbar.title) %></div>
|
|
10
|
+
<div class='message'><%- markdown(snackbar.message) %></div>
|
|
11
|
+
<% if (snackbar.buttons && snackbar.buttons.length > 0) { %>
|
|
12
|
+
<div class="action">
|
|
13
|
+
<% snackbar.buttons.forEach((ac, i) => { %>
|
|
14
|
+
<% if (ac.dismiss) { %>
|
|
15
|
+
<a onclick="document.getElementsByClassName('snackbar-wrap')[0].style.display = 'none'">
|
|
16
|
+
<%- ac.title %>
|
|
17
|
+
</a>
|
|
18
|
+
<% } else { %>
|
|
19
|
+
<a href='<%- ac.url %>'>
|
|
20
|
+
<%- ac.title %>
|
|
21
|
+
</a>
|
|
22
|
+
<% } %>
|
|
23
|
+
<% }) %>
|
|
24
|
+
</div>
|
|
25
|
+
<% } %>
|
|
26
|
+
</div>
|
|
27
|
+
</div>`
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
<% } else if (snackbar.position == 'right') { %>
|
|
31
|
+
<% if (snackbar.buttons && snackbar.buttons.length > 0) { %>
|
|
32
|
+
<script>
|
|
33
|
+
function Snackbar(){
|
|
34
|
+
<% snackbar.buttons.forEach((ac, i) => { %>
|
|
35
|
+
VolantisApp.message(
|
|
36
|
+
'<%- snackbar.title %>',
|
|
37
|
+
'<%- snackbar.message %><br>' + "<a href='<%- ac.url %>'><%- ac.title %></a>"
|
|
38
|
+
);
|
|
39
|
+
<% }) %>
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<% } %>
|
|
43
|
+
<% } %>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
<% if (snackbar.cache) { %>
|
|
47
|
+
if (!localStorage.getItem('Snackbar')) {
|
|
48
|
+
localStorage.setItem('Snackbar', '1');
|
|
49
|
+
Snackbar();
|
|
50
|
+
}
|
|
51
|
+
<% } else { %>
|
|
52
|
+
Snackbar()
|
|
53
|
+
<% }%>
|
|
54
|
+
</script>
|
|
55
|
+
<% } %>
|
|
File without changes
|