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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.css("<%- theme.plugins.aplayer.css %>");
|
|
3
|
+
(async () => {
|
|
4
|
+
// APlayer 需要在 MetingJS 之前加载
|
|
5
|
+
await volantis.js("<%- theme.plugins.aplayer.js.aplayer %>")
|
|
6
|
+
await volantis.js("<%- theme.plugins.aplayer.js.meting %>")
|
|
7
|
+
<% if ((theme.rightmenu.enable || theme.rightmenus.enable) && theme.rightmenu.layout.includes('music')) { %>
|
|
8
|
+
// 右键 music 需要在 APlayer MetingJS 之后加载
|
|
9
|
+
await volantis.js('<%- theme.cdn.addJS("plugins/aplayer") %>')
|
|
10
|
+
<% } %>
|
|
11
|
+
})();
|
|
12
|
+
|
|
13
|
+
function SetAPlayerPlugin(){
|
|
14
|
+
let Metings = document.querySelectorAll('meting-js');
|
|
15
|
+
if (Metings.length === 0) {return;};
|
|
16
|
+
if (Metings[0].aplayer && Metings[0].aplayer.on) {
|
|
17
|
+
// improve the accessibility https://web.dev/button-name/
|
|
18
|
+
document.querySelectorAll(".aplayer-icon-menu").forEach(e=>{
|
|
19
|
+
e.setAttribute("aria-label","Aplayer Menu")
|
|
20
|
+
})
|
|
21
|
+
// message see: /layout/_plugins/message/script.ejs
|
|
22
|
+
<% if (theme.plugins.message.enable && theme.plugins.message.aplayer.enable) { %>
|
|
23
|
+
try {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
Metings.forEach((item, index) => {
|
|
26
|
+
const aplayerItem = item.aplayer; if(!aplayerItem) return;
|
|
27
|
+
const rightAplayerCheck = '<%= theme.rightmenu.layout.includes("music") %>' === 'true'
|
|
28
|
+
&& item.meta.id === '<%= theme.plugins.aplayer.id %>';
|
|
29
|
+
if(rightAplayerCheck) RightMenuAplayer.checkAPlayer();
|
|
30
|
+
if(aplayerItem.events.events.play.every(item => {return item.name !== 'messagePlay'})) {
|
|
31
|
+
aplayerItem.on('play', function messagePlay() {
|
|
32
|
+
let index = aplayerItem.list.index;
|
|
33
|
+
let title = aplayerItem.list.audios[index].title;
|
|
34
|
+
let artist = aplayerItem.list.audios[index].artist;
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
VolantisApp.message('音乐通知', title + ' - ' + artist, {
|
|
37
|
+
icon: '<%- theme.plugins.message.aplayer.play %>',
|
|
38
|
+
transitionIn: 'flipInX',
|
|
39
|
+
transitionOut: 'flipOutX'
|
|
40
|
+
});
|
|
41
|
+
}, 100)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if(aplayerItem.events.events.pause.every(item => {return item.name !== 'messagePause'})) {
|
|
45
|
+
aplayerItem.on('pause', function messagePause() {
|
|
46
|
+
let index = aplayerItem.list.index;
|
|
47
|
+
let title = aplayerItem.list.audios[index].title;
|
|
48
|
+
let artist = aplayerItem.list.audios[index].artist;
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
// 歌曲播放结束也会触发 pause 事件,为了避免错误提示,等待一会儿
|
|
51
|
+
if(aplayerItem.paused) {
|
|
52
|
+
VolantisApp.message('音乐通知', title + ' - ' + artist, {
|
|
53
|
+
icon: '<%- theme.plugins.message.aplayer.pause %>',
|
|
54
|
+
transitionIn: 'flipInX',
|
|
55
|
+
transitionOut: 'flipOutX'
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}, 100)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}, 500)
|
|
63
|
+
} catch (error) { console.error(error); }
|
|
64
|
+
<% } %>
|
|
65
|
+
}else{
|
|
66
|
+
volantis.requestAnimationFrame(SetAPlayerPlugin)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
document.addEventListener("DOMContentLoaded", ()=>{
|
|
71
|
+
SetAPlayerPlugin();
|
|
72
|
+
});
|
|
73
|
+
volantis.pjax.push(SetAPlayerPlugin);
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
// https://sidecar.gitter.im/
|
|
3
|
+
((window.gitter = {}).chat = {}).options = {
|
|
4
|
+
room: `<%- theme.plugins.gitter.room %>`
|
|
5
|
+
};
|
|
6
|
+
volantis.js("https://sidecar.gitter.im/dist/sidecar.v1.js")
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<style>
|
|
10
|
+
.gitter-chat-embed{
|
|
11
|
+
z-index: 10000;
|
|
12
|
+
}
|
|
13
|
+
.gitter-open-chat-button{
|
|
14
|
+
left: 10px;
|
|
15
|
+
right: unset;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%- partial( theme.plugins.chat_service + "/script") %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<script src="https://code.tidio.co/<%- theme.plugins.tidio.id %>.js" async></script>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="artalk_container"><i class="fa-solid fa-cog fa-spin fa-fw fa-2x"></i></div>`);
|
|
3
|
+
function load_artalk() {
|
|
4
|
+
if(!document.querySelectorAll("#artalk_container")[0])return;
|
|
5
|
+
volantis.css("<%- theme.comments.artalk.css %>");
|
|
6
|
+
volantis.js("<%- theme.comments.artalk.js %>").then(pjax_artalk);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function pjax_artalk() {
|
|
10
|
+
if(!document.querySelectorAll("#artalk_container")[0])return;
|
|
11
|
+
let path = pdata.commentPath;
|
|
12
|
+
let placeholder = pdata.commentPlaceholder || "<%= theme.comments.artalk.placeholder %>" || "";
|
|
13
|
+
if (path.length == 0) {
|
|
14
|
+
path = '<%= theme.comments.artalk.path %>' || decodeURI(window.location.pathname);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
volantis.artalk = new Artalk(Object.assign(<%- JSON.stringify(theme.comments.artalk) %>, {
|
|
18
|
+
el: '#artalk_container',
|
|
19
|
+
pageKey: path,
|
|
20
|
+
pageTitle: document.title,
|
|
21
|
+
placeholder: placeholder,
|
|
22
|
+
useBackendConf: true,
|
|
23
|
+
site: '<%= config.title %>',
|
|
24
|
+
darkMode: volantis.dark.mode === "dark",
|
|
25
|
+
pvEl: '#artalk_visitors'
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
volantis.artalk.then(ctx => {
|
|
29
|
+
ctx.on('comments-loaded', () => {
|
|
30
|
+
if (typeof VolantisFancyBox === "undefined"){
|
|
31
|
+
const checkFancyBox = setInterval(() => {
|
|
32
|
+
if(typeof VolantisFancyBox === "undefined") return;
|
|
33
|
+
clearInterval(checkFancyBox);
|
|
34
|
+
VolantisFancyBox.groupBind('.atk-content img:not([atk-emoticon])', 'Comments');
|
|
35
|
+
})
|
|
36
|
+
} else {
|
|
37
|
+
VolantisFancyBox.groupBind('.atk-content img:not([atk-emoticon])', 'Comments');
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
load_artalk();
|
|
44
|
+
volantis.pjax.push(()=>{
|
|
45
|
+
if (typeof Artalk === "undefined") {
|
|
46
|
+
load_artalk();
|
|
47
|
+
} else {
|
|
48
|
+
pjax_artalk();
|
|
49
|
+
}
|
|
50
|
+
},'artalk');
|
|
51
|
+
|
|
52
|
+
function dark_artalk() {
|
|
53
|
+
if(!document.querySelectorAll("#artalk_container")[0]) return;
|
|
54
|
+
volantis.artalk.then(ctx => {
|
|
55
|
+
ctx.setDarkMode(volantis.dark.mode === "dark")
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
volantis.dark.push(dark_artalk);
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="beaudar_container"></div>`)
|
|
3
|
+
|
|
4
|
+
volantis.beaudar = {};
|
|
5
|
+
|
|
6
|
+
function check_beaudar() {
|
|
7
|
+
if (volantis.dark.mode === "dark") {
|
|
8
|
+
volantis.beaudar.Theme = '<%- theme.comments.beaudar.theme.dark %>';
|
|
9
|
+
} else {
|
|
10
|
+
volantis.beaudar.Theme = '<%- theme.comments.beaudar.theme.light %>';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return document.getElementById("beaudar_container");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function pjax_beaudar() {
|
|
17
|
+
const HEAD = check_beaudar();
|
|
18
|
+
if (!HEAD) return;
|
|
19
|
+
|
|
20
|
+
const script = document.createElement('script');
|
|
21
|
+
let issuenumber = "<%- theme.comments.beaudar['issue-number'] %>";
|
|
22
|
+
if (issuenumber) {
|
|
23
|
+
script.setAttribute('issue-number', issuenumber);
|
|
24
|
+
} else {
|
|
25
|
+
script.setAttribute('issue-term', "<%- theme.comments.beaudar['issue-term'] %>");
|
|
26
|
+
}
|
|
27
|
+
script.setAttribute('src', 'https://beaudar.lipk.org/client.js');
|
|
28
|
+
script.setAttribute('repo', '<%- theme.comments.beaudar.repo %>');
|
|
29
|
+
script.setAttribute('input-position', '<%- theme.comments.beaudar.position %>');
|
|
30
|
+
script.setAttribute('branch', '<%- theme.comments.beaudar.branch %>');
|
|
31
|
+
script.setAttribute('comment-order', '<%- theme.comments.beaudar.order %>');
|
|
32
|
+
script.setAttribute('label', '<%- theme.comments.beaudar.label %>');
|
|
33
|
+
script.setAttribute('theme', volantis.beaudar.Theme);
|
|
34
|
+
script.setAttribute('crossorigin', "anonymous");
|
|
35
|
+
HEAD.appendChild(script);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function dark_beaudar() {
|
|
39
|
+
const HEAD = check_beaudar();
|
|
40
|
+
if (!HEAD) return;
|
|
41
|
+
|
|
42
|
+
const message = {
|
|
43
|
+
type: 'set-theme',
|
|
44
|
+
theme: volantis.beaudar.Theme
|
|
45
|
+
};
|
|
46
|
+
const beaudarIframe = document.querySelector('iframe');
|
|
47
|
+
beaudarIframe.contentWindow.postMessage(message, 'https://beaudar.lipk.org');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function check_beaudar_style() {
|
|
51
|
+
// Beaudar 会往 HEAD 的首节点追加样式元素,而这个追加没有添加判断
|
|
52
|
+
// 所以 Pjax 下会多次添加样式文件,略微麻烦。
|
|
53
|
+
const checkStyle = document.querySelector('head').firstElementChild;
|
|
54
|
+
if(checkStyle.innerText.includes('beaudar')) checkStyle.remove();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
pjax_beaudar();
|
|
58
|
+
volantis.pjax.push(check_beaudar_style);
|
|
59
|
+
volantis.pjax.push(pjax_beaudar);
|
|
60
|
+
volantis.dark.push(dark_beaudar);
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="discuss_container"><i class="fa-solid fa-cog fa-spin fa-fw fa-2x"></i></div>`)
|
|
3
|
+
function load_discuss() {
|
|
4
|
+
if(!document.querySelectorAll("#discuss_container")[0])return;
|
|
5
|
+
volantis.js("<%- theme.comments.discuss.js %>", pjax_discuss)
|
|
6
|
+
}
|
|
7
|
+
function pjax_discuss() {
|
|
8
|
+
if(!document.querySelectorAll("#discuss_container")[0])return;
|
|
9
|
+
let path = pdata.commentPath;
|
|
10
|
+
let placeholder = pdata.commentPlaceholder || "<%= theme.comments.discuss.ph %>" || "";
|
|
11
|
+
if (path.length == 0) {
|
|
12
|
+
let defaultPath = '<%= theme.comments.discuss.path %>';
|
|
13
|
+
path = defaultPath || decodeURI(window.location.pathname);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
Discuss.init(Object.assign(Object.assign(<%- JSON.stringify(theme.comments.discuss) %>, {
|
|
17
|
+
el: '#discuss_container',
|
|
18
|
+
path: path,
|
|
19
|
+
ph: placeholder
|
|
20
|
+
}),pdata.commentConfig))
|
|
21
|
+
}
|
|
22
|
+
load_discuss();
|
|
23
|
+
volantis.pjax.push(()=>{
|
|
24
|
+
if (typeof Discuss == "undefined") {
|
|
25
|
+
load_discuss();
|
|
26
|
+
} else {
|
|
27
|
+
pjax_discuss();
|
|
28
|
+
}
|
|
29
|
+
},'discuss');
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="disqus_thread">
|
|
3
|
+
<div id="notShowDisqus" style="display: none;text-align: center;"><i class='fa-solid fa-exclamation-triangle'></i> <%- __('post.comments_placeholder', 'Disqus') %></div>
|
|
4
|
+
<div id="load-btns"><a class="load-comments" onclick="needLoadDisqus()"><%- __('post.comments_load', 'Disqus') %></a></div>
|
|
5
|
+
<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>
|
|
6
|
+
</div>
|
|
7
|
+
`)
|
|
8
|
+
|
|
9
|
+
const disqus_shortname = "<%= theme.comments.disqus.shortname %>";
|
|
10
|
+
const autoload = "<%= theme.comments.disqus.autoload %>";
|
|
11
|
+
const global_url = "<%= config.url %>"; // must use an absolute URL; relative URLs won’t work.
|
|
12
|
+
|
|
13
|
+
function checkDisqus() {
|
|
14
|
+
// 正在检查 Disqus 能否访问...
|
|
15
|
+
const runcheck = (domain) => {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const img = new Image();
|
|
18
|
+
const timeout = setTimeout(() => {
|
|
19
|
+
img.onerror = img.onload = null;
|
|
20
|
+
reject();
|
|
21
|
+
}, 3000);
|
|
22
|
+
img.onerror = () => {
|
|
23
|
+
clearTimeout(timeout);
|
|
24
|
+
reject();
|
|
25
|
+
};
|
|
26
|
+
img.onload = () => {
|
|
27
|
+
clearTimeout(timeout);
|
|
28
|
+
resolve();
|
|
29
|
+
};
|
|
30
|
+
img.src = `https://${domain}/favicon.ico?${+new Date()}=${+new Date()}`;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return Promise.all([
|
|
34
|
+
runcheck("<%= theme.comments.disqus.shortname %>.disqus.com"),
|
|
35
|
+
]).then(loadDisqus, showError);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function loadDisqus() {
|
|
39
|
+
let path = pdata.commentPath;
|
|
40
|
+
if (path.length == 0) {
|
|
41
|
+
let defaultPath = "<%= theme.comments.disqus.path %>";
|
|
42
|
+
path = defaultPath || decodeURI(window.location.pathname);
|
|
43
|
+
}
|
|
44
|
+
if (window.DISQUS) {
|
|
45
|
+
window.DISQUS.reset({
|
|
46
|
+
reload: true,
|
|
47
|
+
config() {
|
|
48
|
+
this.page.identifier = global_url + path;
|
|
49
|
+
this.page.url = global_url + path;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
window.disqus_config = function () {
|
|
54
|
+
this.page.url = global_url + path;
|
|
55
|
+
this.page.identifier = global_url + path;
|
|
56
|
+
};
|
|
57
|
+
let d = document,
|
|
58
|
+
s = d.createElement("script");
|
|
59
|
+
s.async = true;
|
|
60
|
+
s.src = "//" + disqus_shortname + ".disqus.com/embed.js";
|
|
61
|
+
s.setAttribute("data-timestamp", +new Date());
|
|
62
|
+
(d.head || d.body).appendChild(s);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 加载错误
|
|
67
|
+
function showError() {
|
|
68
|
+
volantis.dom.$(document.getElementById("loading-comments")).hide();
|
|
69
|
+
volantis.dom.$(document.getElementById("notShowDisqus")).show();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 点击了加载
|
|
73
|
+
function needLoadDisqus() {
|
|
74
|
+
checkDisqus();
|
|
75
|
+
volantis.dom.$(document.getElementById("load-btns")).hide();
|
|
76
|
+
volantis.dom.$(document.getElementById("loading-comments")).show();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// pjax 重载
|
|
80
|
+
function pjax_disqus() {
|
|
81
|
+
// 排除当前页面不存在评论框的情形
|
|
82
|
+
if (!document.getElementById("disqus_thread")) return;
|
|
83
|
+
// 如果 DISQUS 已被实例化,则可直接加载
|
|
84
|
+
if (window.DISQUS) {
|
|
85
|
+
volantis.dom.$(document.getElementById("load-btns")).hide();
|
|
86
|
+
volantis.dom.$(document.getElementById("notShowDisqus")).hide();
|
|
87
|
+
volantis.dom.$(document.getElementById("loading-comments")).hide();
|
|
88
|
+
loadDisqus();
|
|
89
|
+
} else if (autoload == "true") {
|
|
90
|
+
// 设置自动加载但是上个页面加载失败了
|
|
91
|
+
needLoadDisqus();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (autoload == "true") {
|
|
95
|
+
needLoadDisqus();
|
|
96
|
+
}
|
|
97
|
+
volantis.pjax.push(pjax_disqus);
|
|
98
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="disqus_thread"></div>`)
|
|
3
|
+
// from: https://github.com/ChrAlpha/hexo-theme-cards/blob/master/layout/_plugins/comments/disqusjs/source.ejs
|
|
4
|
+
function loadDisqusJS() {
|
|
5
|
+
volantis.js('<%= theme.comments.disqusjs.js %>', pjax_DisqusJS)
|
|
6
|
+
volantis.css('<%= theme.comments.disqusjs.css %>')
|
|
7
|
+
}
|
|
8
|
+
let path = pdata.commentPath;
|
|
9
|
+
if (path.length == 0) {
|
|
10
|
+
let defaultPath = '<%= theme.comments.disqusjs.path %>';
|
|
11
|
+
path = defaultPath || decodeURI(window.location.pathname);
|
|
12
|
+
}
|
|
13
|
+
pjax_DisqusJS = () => {
|
|
14
|
+
new DisqusJS(Object.assign(<%- JSON.stringify(theme.comments.disqusjs) %>, {
|
|
15
|
+
siteName: '<%= config.title %>',
|
|
16
|
+
url: '<%= page.permalink %>',
|
|
17
|
+
identifier: path,
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
var runningOnBrowser = typeof window !== "undefined";
|
|
21
|
+
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro|msn)bot|crawl|spider|yand|duckgo/i.test(navigator.userAgent);
|
|
22
|
+
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
|
|
23
|
+
if (!isBot && supportsIntersectionObserver) {
|
|
24
|
+
var comment_observer = new IntersectionObserver(function(entries) {
|
|
25
|
+
if (entries[0].isIntersecting) {
|
|
26
|
+
loadDisqusJS();
|
|
27
|
+
comment_observer.disconnect();
|
|
28
|
+
}
|
|
29
|
+
}, { threshold: [0] });
|
|
30
|
+
comment_observer.observe(document.getElementById('comments'));
|
|
31
|
+
} else {
|
|
32
|
+
loadDisqusJS();
|
|
33
|
+
}
|
|
34
|
+
volantis.pjax.push(pjax_DisqusJS);
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="giscus_container"></div>`)
|
|
3
|
+
|
|
4
|
+
volantis.giscus = {};
|
|
5
|
+
|
|
6
|
+
function check_giscus() {
|
|
7
|
+
if (volantis.dark.mode === "dark") {
|
|
8
|
+
volantis.giscus.Theme = '<%- theme.comments.giscus.theme.dark %>';
|
|
9
|
+
} else {
|
|
10
|
+
volantis.giscus.Theme = '<%- theme.comments.giscus.theme.light %>';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return document.getElementById("giscus_container");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function pjax_giscus() {
|
|
17
|
+
const HEAD = check_giscus();
|
|
18
|
+
if (!HEAD) return;
|
|
19
|
+
let cfg = Object.assign(<%- JSON.stringify(theme.comments.giscus) %>,pdata.commentConfig)
|
|
20
|
+
const script = document.createElement('script');
|
|
21
|
+
script.setAttribute('src', 'https://giscus.app/client.js');
|
|
22
|
+
Object.keys(cfg).forEach(k=>{
|
|
23
|
+
if (k != "theme") {
|
|
24
|
+
script.setAttribute('data-'+k, cfg[k]);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
script.setAttribute('data-theme', volantis.giscus.Theme);
|
|
28
|
+
script.setAttribute('crossorigin', "anonymous");
|
|
29
|
+
HEAD.appendChild(script);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function dark_giscus() {
|
|
33
|
+
const HEAD = check_giscus();
|
|
34
|
+
if (!HEAD) return;
|
|
35
|
+
|
|
36
|
+
const message = {
|
|
37
|
+
setConfig: {
|
|
38
|
+
theme: volantis.giscus.Theme
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const giscusIframe = document.querySelector('iframe.giscus-frame');
|
|
42
|
+
giscusIframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
|
43
|
+
}
|
|
44
|
+
pjax_giscus();
|
|
45
|
+
volantis.pjax.push(pjax_giscus);
|
|
46
|
+
volantis.dark.push(dark_giscus);
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="gitalk-container"></div>`)
|
|
3
|
+
function pjax_gitalk() {
|
|
4
|
+
if(!document.querySelector("#gitalk-container"))return;
|
|
5
|
+
let path = pdata.commentPath;
|
|
6
|
+
if (path.length == 0) {
|
|
7
|
+
let defaultPath = '<%= theme.comments.gitalk.path %>';
|
|
8
|
+
path = defaultPath || decodeURI(window.location.pathname);
|
|
9
|
+
}
|
|
10
|
+
if (document.getElementById('gitalk-container') != null) {
|
|
11
|
+
var gitalk = new Gitalk(
|
|
12
|
+
Object.assign(
|
|
13
|
+
Object.assign(<%- JSON.stringify(theme.comments.gitalk) %>, {
|
|
14
|
+
id: path,
|
|
15
|
+
distractionFreeMode: false // Facebook-like distraction free mode
|
|
16
|
+
}),
|
|
17
|
+
pdata.commentConfig)
|
|
18
|
+
);
|
|
19
|
+
gitalk.render('gitalk-container');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
volantis.js('<%= theme.comments.gitalk.js %>').then(pjax_gitalk)
|
|
23
|
+
volantis.pjax.push(pjax_gitalk);
|
|
24
|
+
</script>
|
|
@@ -4,14 +4,21 @@
|
|
|
4
4
|
checkComment = false;
|
|
5
5
|
}
|
|
6
6
|
%>
|
|
7
|
-
<% if (checkComment
|
|
8
|
-
|
|
7
|
+
<% if (checkComment&&(theme.comments.service && theme.comments.service.length > 0)) { %>
|
|
8
|
+
|
|
9
|
+
<article class="post white-box <%- theme.custom_css.body.effect.join(' ') %>" id="comments">
|
|
10
|
+
<span hidden>
|
|
11
|
+
<meta itemprop="discussionUrl" content="<%- url_for(path) %>#comments">
|
|
12
|
+
</span>
|
|
9
13
|
<p ct><%- theme.comments && theme.comments.title %></p>
|
|
10
14
|
<% if (theme.comments && theme.comments.subtitle) { %>
|
|
11
15
|
<p cst><%- theme.comments.subtitle %></p>
|
|
12
16
|
<% } %>
|
|
13
|
-
|
|
17
|
+
|
|
18
|
+
<div id="layoutHelper-comments"></div>
|
|
19
|
+
|
|
14
20
|
</article>
|
|
21
|
+
|
|
15
22
|
<% } else { %>
|
|
16
23
|
<% page.comments = false; %>
|
|
17
24
|
<% } %>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="isso-thread"></div>`)
|
|
3
|
+
function loadIsso() {
|
|
4
|
+
let d = document,
|
|
5
|
+
s = d.createElement("script");
|
|
6
|
+
s.src = "<%= theme.comments.isso.src %>";
|
|
7
|
+
s.setAttribute("data-isso", "<%= theme.comments.isso.url %>");
|
|
8
|
+
<% if (theme.comments.isso.css) { %>
|
|
9
|
+
s.setAttribute("data-isso-css", "<%= theme.comments.isso.css %>");
|
|
10
|
+
<% } %>
|
|
11
|
+
<% if (theme.comments.isso.gravatar) { %>
|
|
12
|
+
s.setAttribute("data-isso-gravatar", "true");
|
|
13
|
+
s.setAttribute("data-isso-avatar", "false");
|
|
14
|
+
<% } %>
|
|
15
|
+
(d.head || d.body).appendChild(s);
|
|
16
|
+
}
|
|
17
|
+
function pjax_isso() {
|
|
18
|
+
if (window.Isso) {
|
|
19
|
+
window.Isso.init();
|
|
20
|
+
window.Isso.fetchComments();
|
|
21
|
+
} else if (document.querySelector("#isso-thread")) {
|
|
22
|
+
loadIsso();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
pjax_isso();
|
|
26
|
+
volantis.pjax.push(pjax_isso);
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="lv-container" data-id="city" data-uid="<%= theme.comments.livere.uid %>">
|
|
3
|
+
<noscript><div><i class='fa-solid fa-exclamation-triangle'> <%- __('post.comments_placeholder', 'Livere') %></div></noscript>
|
|
4
|
+
</div>`)
|
|
5
|
+
</script>
|
|
6
|
+
<script data-pjax type="text/javascript">
|
|
7
|
+
(function(d, s) {
|
|
8
|
+
var j, e = d.getElementsByTagName(s)[0];
|
|
9
|
+
if (typeof LivereTower === 'function') { return; }
|
|
10
|
+
j = d.createElement(s);
|
|
11
|
+
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
|
12
|
+
j.async = true;
|
|
13
|
+
e.parentNode.insertBefore(j, e);
|
|
14
|
+
})(document, 'script');
|
|
15
|
+
</script>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="twikoo_container"><i class="fa-solid fa-cog fa-spin fa-fw fa-2x"></i></div>`)
|
|
3
|
+
function load_twikoo() {
|
|
4
|
+
if(!document.querySelectorAll("#twikoo_container")[0])return;
|
|
5
|
+
volantis.js("<%- theme.comments.twikoo.js %>", pjax_twikoo)
|
|
6
|
+
}
|
|
7
|
+
function pjax_twikoo() {
|
|
8
|
+
if(!document.querySelectorAll("#twikoo_container")[0])return;
|
|
9
|
+
let path = pdata.commentPath;
|
|
10
|
+
let placeholder = pdata.commentPlaceholder || "<%= theme.comments.twikoo.placeholder %>" || "";
|
|
11
|
+
if (path.length == 0) {
|
|
12
|
+
let defaultPath = '<%= theme.comments.twikoo.path %>';
|
|
13
|
+
path = defaultPath || decodeURI(window.location.pathname);
|
|
14
|
+
}
|
|
15
|
+
twikoo.init(Object.assign(Object.assign(<%- JSON.stringify(theme.comments.twikoo) %>, {
|
|
16
|
+
el: '#twikoo_container',
|
|
17
|
+
path: path,
|
|
18
|
+
placeholder: placeholder,
|
|
19
|
+
onCommentLoaded: function() {
|
|
20
|
+
if(typeof VolantisFancyBox === "undefined") {
|
|
21
|
+
const checkFancyBox = setInterval(() => {
|
|
22
|
+
if(typeof VolantisFancyBox === "undefined") return;
|
|
23
|
+
clearInterval(checkFancyBox);
|
|
24
|
+
VolantisFancyBox.groupBind('.tk-content img:not([class*="emo"])', 'Comments');
|
|
25
|
+
})
|
|
26
|
+
} else {
|
|
27
|
+
VolantisFancyBox.groupBind('.tk-content img:not([class*="emo"])', 'Comments');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}),pdata.commentConfig))
|
|
31
|
+
}
|
|
32
|
+
load_twikoo();
|
|
33
|
+
volantis.pjax.push(()=>{
|
|
34
|
+
if (typeof twikoo == "undefined") {
|
|
35
|
+
load_twikoo();
|
|
36
|
+
} else {
|
|
37
|
+
pjax_twikoo();
|
|
38
|
+
}
|
|
39
|
+
},'twikoo');
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
volantis.layoutHelper("comments",`<div id="utterances"></div>`)
|
|
3
|
+
volantis.utterances={}
|
|
4
|
+
volantis.utterances.ThemeLight='<%- theme.comments.utterances.theme.light %>';
|
|
5
|
+
volantis.utterances.ThemeDark='<%- theme.comments.utterances.theme.dark %>';
|
|
6
|
+
volantis.utterances.Theme=volantis.utterances.ThemeLight;
|
|
7
|
+
function pjax_utterances(){
|
|
8
|
+
if(!document.getElementById("utterances"))return;
|
|
9
|
+
<% if (theme.plugins.darkmode.enable) { %>
|
|
10
|
+
if(volantis.dark.mode=="dark"){
|
|
11
|
+
volantis.utterances.Theme=volantis.utterances.ThemeDark;
|
|
12
|
+
}else{
|
|
13
|
+
volantis.utterances.Theme=volantis.utterances.ThemeLight;
|
|
14
|
+
}
|
|
15
|
+
<% } %>
|
|
16
|
+
setTimeout(function() {
|
|
17
|
+
var checkUtterances = setInterval(function () {
|
|
18
|
+
var HEAD = document.getElementById("utterances");
|
|
19
|
+
if (!HEAD) return
|
|
20
|
+
clearInterval(checkUtterances)
|
|
21
|
+
try {
|
|
22
|
+
document.getElementById("utterances").innerHTML="";
|
|
23
|
+
} catch (error) {}
|
|
24
|
+
var script = document.createElement('script');
|
|
25
|
+
script.setAttribute('src','https://utteranc.es/client.js');
|
|
26
|
+
script.setAttribute('repo','<%- theme.comments.utterances.repo %>');
|
|
27
|
+
let issuenumber = '<%- theme.comments.utterances['issue-number'] %>';
|
|
28
|
+
if (issuenumber) {
|
|
29
|
+
script.setAttribute('issue-number', issuenumber);
|
|
30
|
+
} else {
|
|
31
|
+
script.setAttribute('issue-term', '<%- theme.comments.utterances['issue-term'] %>');
|
|
32
|
+
}
|
|
33
|
+
script.setAttribute('theme', volantis.utterances.Theme );
|
|
34
|
+
script.setAttribute('label','<%- theme.comments.utterances.label %>');
|
|
35
|
+
script.setAttribute('crossorigin', "anonymous");
|
|
36
|
+
HEAD.appendChild(script);
|
|
37
|
+
}, 200)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
pjax_utterances();
|
|
41
|
+
volantis.pjax.push(pjax_utterances);
|
|
42
|
+
volantis.dark.push(pjax_utterances);
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
<script src="<%- theme.comments.vssue.vue %>"></script>
|
|
3
|
+
<script src="<%- theme.comments.vssue.js %>"></script>
|
|
4
|
+
<script>
|
|
5
|
+
volantis.css("<%- theme.comments.vssue.css %>");
|
|
6
|
+
function fancybox_vssue() {
|
|
7
|
+
if(typeof VolantisFancyBox === "undefined") {
|
|
8
|
+
const checkFancyBox = setInterval(() => {
|
|
9
|
+
if(typeof VolantisFancyBox === "undefined") return;
|
|
10
|
+
clearInterval(checkFancyBox);
|
|
11
|
+
VolantisFancyBox.bind('#vssue .vssue-comment-main img');
|
|
12
|
+
})
|
|
13
|
+
} else {
|
|
14
|
+
VolantisFancyBox.bind('#vssue .vssue-comment-main img');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
<script data-pjax>
|
|
19
|
+
volantis.layoutHelper("comments",`<div id="vssue"></div>`);
|
|
20
|
+
new Vue({
|
|
21
|
+
el: '#vssue',
|
|
22
|
+
render: h => h('Vssue', {
|
|
23
|
+
props: {
|
|
24
|
+
title: "<%- (page.seo_title || page.title) + ' - ' + config.title %>",
|
|
25
|
+
options: {
|
|
26
|
+
owner: '<%- theme.comments.vssue.owner %>',
|
|
27
|
+
repo: '<%- theme.comments.vssue.repo %>',
|
|
28
|
+
clientId: '<%- theme.comments.vssue.clientId %>',
|
|
29
|
+
clientSecret: '<%- theme.comments.vssue.clientSecret %>',
|
|
30
|
+
prefix: '',
|
|
31
|
+
autoCreateIssue: true,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
fancybox_vssue();
|
|
37
|
+
</script>
|