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.
Files changed (309) hide show
  1. package/README.md +6 -4
  2. package/_config.yml +599 -246
  3. package/languages/en.yml +7 -0
  4. package/languages/zh-CN.yml +13 -2
  5. package/languages/zh-TW.yml +7 -0
  6. package/layout/404.ejs +1 -1
  7. package/layout/_meta/author.ejs +4 -4
  8. package/layout/_meta/category.ejs +11 -8
  9. package/layout/_meta/counter.ejs +29 -7
  10. package/layout/_meta/date.ejs +1 -1
  11. package/layout/_meta/music.ejs +1 -1
  12. package/layout/_meta/share.ejs +1 -1
  13. package/layout/_meta/tags.ejs +3 -0
  14. package/layout/_meta/thumbnail.ejs +3 -1
  15. package/layout/_meta/updated.ejs +1 -1
  16. package/layout/_meta/walinecount.ejs +2 -1
  17. package/layout/{_cover → _partial/_cover}/blank.ejs +0 -0
  18. package/layout/{_cover → _partial/_cover}/dock.ejs +1 -1
  19. package/layout/{_cover → _partial/_cover}/featured.ejs +1 -1
  20. package/layout/{_cover → _partial/_cover}/focus.ejs +1 -1
  21. package/layout/_partial/_cover/layout.ejs +8 -0
  22. package/layout/{_cover → _partial/_cover}/search.ejs +2 -2
  23. package/layout/_partial/archive.ejs +2 -2
  24. package/layout/_partial/article.ejs +21 -16
  25. package/layout/_partial/categories.ejs +1 -1
  26. package/layout/_partial/cover.ejs +8 -28
  27. package/layout/_partial/footer.ejs +19 -11
  28. package/layout/_partial/head.ejs +70 -116
  29. package/layout/_partial/header.ejs +17 -11
  30. package/layout/_partial/meta.ejs +18 -4
  31. package/layout/_partial/post.ejs +35 -9
  32. package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +126 -0
  33. package/layout/_partial/scripts/{coverCtrl.ejs → _ctrl/coverCtrl.ejs} +17 -25
  34. package/layout/_partial/scripts/_ctrl.ejs +2 -0
  35. package/layout/_partial/scripts/content-visibility-scroll-fix.ejs +88 -0
  36. package/layout/_partial/scripts/global.ejs +422 -109
  37. package/layout/_partial/scripts/index.ejs +91 -46
  38. package/layout/_partial/scripts/toc.ejs +98 -68
  39. package/layout/_partial/side.ejs +4 -1
  40. package/layout/_plugins/_page_plugins/artitalk/index.ejs +15 -0
  41. package/layout/_plugins/_page_plugins/bbtalk/index.ejs +10 -0
  42. package/layout/_plugins/_page_plugins/fcircle/index.ejs +12 -0
  43. package/layout/_plugins/_page_plugins/gitter/index.ejs +14 -0
  44. package/layout/_plugins/_page_plugins/indent/index.ejs +16 -0
  45. package/layout/_plugins/_page_plugins/index.ejs +27 -0
  46. package/layout/_plugins/_page_plugins/katex/index.ejs +13 -0
  47. package/layout/{_third-party/math/mathjax/script.ejs → _plugins/_page_plugins/mathjax/index.ejs} +2 -2
  48. package/layout/_plugins/_page_plugins/snackbar/index.ejs +55 -0
  49. package/layout/{_partial/scripts/counter.ejs → _plugins/analytics/LCCounter.ejs} +0 -0
  50. package/layout/{_third-party → _plugins}/analytics/script.ejs +43 -5
  51. package/layout/{_third-party → _plugins}/aplayer/layout.ejs +0 -0
  52. package/layout/_plugins/aplayer/script.ejs +74 -0
  53. package/layout/_plugins/chat/gitter/script.ejs +17 -0
  54. package/layout/_plugins/chat/index.ejs +1 -0
  55. package/layout/_plugins/chat/tidio/script.ejs +1 -0
  56. package/layout/_plugins/comments/artalk/script.ejs +59 -0
  57. package/layout/_plugins/comments/beaudar/script.ejs +61 -0
  58. package/layout/_plugins/comments/discuss/script.ejs +30 -0
  59. package/layout/_plugins/comments/disqus/script.ejs +98 -0
  60. package/layout/_plugins/comments/disqusjs/script.ejs +35 -0
  61. package/layout/_plugins/comments/giscus/script.ejs +47 -0
  62. package/layout/_plugins/comments/gitalk/script.ejs +24 -0
  63. package/layout/_plugins/comments/hashover/script.ejs +5 -0
  64. package/layout/{_third-party → _plugins}/comments/index.ejs +10 -3
  65. package/layout/_plugins/comments/isso/script.ejs +27 -0
  66. package/layout/_plugins/comments/livere/script.ejs +15 -0
  67. package/layout/_plugins/comments/twikoo/script.ejs +40 -0
  68. package/layout/_plugins/comments/utterances/script.ejs +43 -0
  69. package/layout/_plugins/comments/vssue/script.ejs +37 -0
  70. package/layout/_plugins/comments/waline/script.ejs +62 -0
  71. package/layout/_plugins/comments/z-custom/script.ejs +1 -0
  72. package/layout/_plugins/darkmode/script.ejs +114 -0
  73. package/layout/{_third-party → _plugins}/end-of-support/script.ejs +25 -8
  74. package/layout/_plugins/github-api/script.ejs +27 -0
  75. package/layout/_plugins/highlight/highlightjs/script.ejs +26 -0
  76. package/layout/_plugins/highlight/prismjs/script.ejs +25 -0
  77. package/layout/_plugins/highlight/script.ejs +1 -0
  78. package/layout/{_third-party → _plugins}/lazyload/script.ejs +1 -1
  79. package/layout/{_third-party → _plugins}/nodewaves/script.ejs +1 -1
  80. package/layout/_plugins/parallax/script.ejs +74 -0
  81. package/layout/{_third-party → _plugins}/pjax/animate.ejs +31 -31
  82. package/layout/_plugins/pjax/index.ejs +73 -0
  83. package/layout/_plugins/pjax/pdata.ejs +56 -0
  84. package/layout/{_third-party → _plugins}/preload/script.ejs +3 -3
  85. package/layout/_plugins/rightmenu/layout.ejs +119 -0
  86. package/layout/_plugins/rightmenus/layout.ejs +137 -0
  87. package/layout/_plugins/scrollreveal/script.ejs +25 -0
  88. package/layout/_plugins/search/script.ejs +50 -0
  89. package/layout/{_third-party → _plugins}/share/layout.ejs +0 -0
  90. package/layout/_plugins/swiper/script.ejs +37 -0
  91. package/layout/_pre.ejs +2 -2
  92. package/layout/_widget/_pre.ejs +5 -0
  93. package/layout/_widget/blogger.ejs +1 -1
  94. package/layout/_widget/category.ejs +2 -2
  95. package/layout/_widget/copyright.ejs +1 -1
  96. package/layout/_widget/grid.ejs +3 -3
  97. package/layout/_widget/lastupdate.ejs +27 -0
  98. package/layout/_widget/list.ejs +2 -2
  99. package/layout/_widget/load.ejs +18 -0
  100. package/layout/_widget/music.ejs +3 -2
  101. package/layout/_widget/page.ejs +1 -1
  102. package/layout/_widget/qrcode.ejs +1 -1
  103. package/layout/_widget/related_posts.ejs +1 -1
  104. package/layout/_widget/tagcloud.ejs +1 -1
  105. package/layout/_widget/text.ejs +1 -1
  106. package/layout/_widget/toc.ejs +6 -2
  107. package/layout/_widget/webinfo.ejs +13 -76
  108. package/layout/archive.ejs +4 -4
  109. package/layout/category.ejs +9 -4
  110. package/layout/docs.ejs +1 -1
  111. package/layout/friends.ejs +6 -25
  112. package/layout/index.ejs +1 -1
  113. package/layout/layout.ejs +30 -12
  114. package/layout/list.ejs +1 -1
  115. package/layout/page.ejs +1 -1
  116. package/layout/post.ejs +1 -1
  117. package/layout/tag.ejs +8 -3
  118. package/package.json +5 -3
  119. package/scripts/events/index.js +13 -0
  120. package/scripts/events/lib/check-configuration.js +43 -0
  121. package/scripts/events/lib/check-environment.js +74 -0
  122. package/scripts/events/lib/config.js +34 -9
  123. package/scripts/events/lib/render-stylus.js +78 -0
  124. package/scripts/events/lib/stellar-tag-utils.js +76 -0
  125. package/scripts/filters/content-visibility.js +25 -0
  126. package/scripts/{render → filters}/img.js +0 -0
  127. package/scripts/filters/replace.js +15 -0
  128. package/scripts/{z-lazyload/lib/process.js → filters/z-lazyload.js} +6 -3
  129. package/scripts/helpers/custom-files.js +165 -0
  130. package/scripts/helpers/first-style.js +19 -0
  131. package/scripts/helpers/head/autoCanonical.js +15 -0
  132. package/scripts/helpers/head/generate_preload_fontfamily.js +22 -0
  133. package/scripts/helpers/head/generate_seo.js +24 -0
  134. package/scripts/helpers/head/generate_title__keywords__description.js +101 -0
  135. package/scripts/{related_posts/index.js → helpers/related-posts.js} +1 -1
  136. package/scripts/helpers/revisioned.js +158 -0
  137. package/scripts/helpers/structured-data/index.js +2 -0
  138. package/scripts/helpers/structured-data/lib/blogposting.js +77 -0
  139. package/scripts/helpers/structured-data/lib/breadcrumblist.js +152 -0
  140. package/scripts/helpers/structured-data/lib/config.js +31 -0
  141. package/scripts/helpers/structured-data/lib/index.js +30 -0
  142. package/scripts/helpers/structured-data/lib/organization.js +15 -0
  143. package/scripts/helpers/structured-data/lib/person.js +16 -0
  144. package/scripts/helpers/structured-data/lib/website.js +42 -0
  145. package/scripts/tags/btn.js +6 -1
  146. package/scripts/tags/btns.js +7 -2
  147. package/scripts/tags/checkbox.js +12 -2
  148. package/scripts/tags/contributors.js +100 -0
  149. package/scripts/tags/dropmenu.js +18 -3
  150. package/scripts/tags/fancybox.js +44 -10
  151. package/scripts/tags/folding.js +6 -1
  152. package/scripts/tags/frame.js +6 -1
  153. package/scripts/tags/friends.js +99 -0
  154. package/scripts/tags/ghcard.js +6 -1
  155. package/scripts/tags/image.js +14 -2
  156. package/scripts/tags/link.js +6 -1
  157. package/scripts/tags/md.js +59 -0
  158. package/scripts/tags/media.js +25 -1
  159. package/scripts/tags/note.js +36 -3
  160. package/scripts/tags/site.js +87 -51
  161. package/scripts/tags/span.js +12 -2
  162. package/scripts/tags/swiper.js +38 -0
  163. package/scripts/tags/tabs.js +33 -3
  164. package/scripts/tags/timeline.js +6 -1
  165. package/source/css/Readme.md +28 -0
  166. package/source/css/_defines/AutoPrefixCSS.styl +347 -0
  167. package/source/css/_defines/Readme.md +3 -0
  168. package/source/css/_defines/color.styl +41 -1
  169. package/source/css/_defines/effect.styl +0 -13
  170. package/source/css/_defines/fonts.styl +17 -18
  171. package/source/css/_defines/func.styl +12 -30
  172. package/source/css/_first/base_first.styl +118 -0
  173. package/source/css/_first/{cover.styl → cover_first.styl} +113 -87
  174. package/source/css/_first/dark_first.styl +76 -0
  175. package/source/css/_first/fontfamily_first.styl +17 -0
  176. package/source/css/_first/{navbar.styl → navbar_first.styl} +4 -10
  177. package/source/css/_first/search_first.styl +12 -0
  178. package/source/css/{_base/index.styl → _style/_base/base.styl} +9 -93
  179. package/source/css/_style/_base/fontfamily_async.styl +8 -0
  180. package/source/css/{_layout → _style/_layout}/archive.styl +0 -0
  181. package/source/css/{_layout → _style/_layout}/article.styl +3 -30
  182. package/source/css/{_layout → _style/_layout}/footer.styl +0 -0
  183. package/source/css/_style/_layout/friends-simpleuser.styl +23 -0
  184. package/source/css/_style/_layout/friends-traditional.styl +81 -0
  185. package/source/css/{_layout → _style/_layout}/img.styl +0 -0
  186. package/source/css/_style/_layout/loading.styl +14 -0
  187. package/source/css/{_layout → _style/_layout}/main.styl +19 -7
  188. package/source/css/{_layout → _style/_layout}/md.styl +0 -0
  189. package/source/css/{_layout → _style/_layout}/pagination.styl +1 -1
  190. package/source/css/{_layout → _style/_layout}/posts.styl +2 -0
  191. package/source/css/{_first → _style/_layout}/search.styl +0 -103
  192. package/source/css/{_layout → _style/_layout}/sidebar.styl +23 -3
  193. package/source/css/{_layout → _style/_layout}/snackbar.styl +0 -0
  194. package/source/css/{_layout → _style/_layout}/toc.styl +3 -3
  195. package/source/css/{_layout → _style/_layout}/video.styl +0 -0
  196. package/source/css/_style/_plugins/_dark/dark_async.styl +41 -0
  197. package/source/css/_style/_plugins/_dark/dark_plugins.styl +136 -0
  198. package/source/css/_style/_plugins/_highlight/highlightjs/clipboard.styl +36 -0
  199. package/source/css/_style/_plugins/_highlight/highlightjs/color.styl +96 -0
  200. package/source/css/_style/_plugins/_highlight/highlightjs/index.styl +102 -0
  201. package/source/css/_style/_plugins/_highlight/highlightjs/language.styl +63 -0
  202. package/source/css/_style/_plugins/_highlight/index.styl +1 -0
  203. package/source/css/_style/_plugins/_highlight/prismjs/clipboard.styl +33 -0
  204. package/source/css/_style/_plugins/_highlight/prismjs/index.styl +8 -0
  205. package/source/css/_style/_plugins/_highlight/prismjs/language.styl +63 -0
  206. package/source/css/_style/_plugins/_rightmenu/reading.styl +56 -0
  207. package/source/css/{_plugins → _style/_plugins/_rightmenu}/rightmenu.styl +22 -2
  208. package/source/css/{_plugins → _style/_plugins}/aplayer.styl +8 -1
  209. package/source/css/{_plugins → _style/_plugins}/cursor.styl +49 -19
  210. package/source/css/_style/_plugins/fontcolor.styl +84 -0
  211. package/source/css/{_plugins → _style/_plugins}/gitalk.styl +0 -0
  212. package/source/css/_style/_plugins/index.styl +24 -0
  213. package/source/css/{_plugins → _style/_plugins}/mathjax.styl +0 -0
  214. package/source/css/_style/_plugins/message.styl +14 -0
  215. package/source/css/{_plugins → _style/_plugins}/pjaxanimate.styl +0 -0
  216. package/source/css/_style/_tag-plugins/Readme.md +6 -0
  217. package/source/css/{_tag-plugins → _style/_tag-plugins}/btns.styl +0 -0
  218. package/source/css/{_tag-plugins → _style/_tag-plugins}/checkbox.styl +0 -0
  219. package/source/css/{_tag-plugins → _style/_tag-plugins}/dropmenu.styl +0 -0
  220. package/source/css/{_plugins → _style/_tag-plugins}/fancybox.styl +8 -9
  221. package/source/css/{_tag-plugins → _style/_tag-plugins}/folding.styl +0 -0
  222. package/source/css/{_tag-plugins → _style/_tag-plugins}/frame.styl +0 -0
  223. package/source/css/_style/_tag-plugins/friends.styl +72 -0
  224. package/source/css/{_tag-plugins → _style/_tag-plugins}/ghcard.styl +0 -0
  225. package/source/css/{_tag-plugins → _style/_tag-plugins}/image.styl +0 -0
  226. package/source/css/{_tag-plugins → _style/_tag-plugins}/link.styl +0 -0
  227. package/source/css/{_tag-plugins → _style/_tag-plugins}/media.styl +0 -0
  228. package/source/css/{_tag-plugins → _style/_tag-plugins}/note.styl +0 -0
  229. package/source/css/_style/_tag-plugins/sites.styl +87 -0
  230. package/source/css/{_tag-plugins → _style/_tag-plugins}/span.styl +0 -0
  231. package/source/css/_style/_tag-plugins/swiper.styl +44 -0
  232. package/source/css/{_tag-plugins → _style/_tag-plugins}/table.styl +0 -0
  233. package/source/css/{_tag-plugins → _style/_tag-plugins}/tabs.styl +0 -0
  234. package/source/css/_style/_tag-plugins/tag.json +35 -0
  235. package/source/css/_style/_tag-plugins/text.styl +31 -0
  236. package/source/css/{_tag-plugins → _style/_tag-plugins}/timeline.styl +0 -0
  237. package/source/css/_style/index.styl +8 -0
  238. package/source/css/first.styl +17 -6
  239. package/source/css/style.styl +9 -7
  240. package/source/js/app.js +1051 -278
  241. package/source/js/plugins/aplayer.js +186 -0
  242. package/source/js/plugins/parallax.js +191 -0
  243. package/source/js/plugins/rightMenu.js +577 -0
  244. package/source/js/plugins/rightMenus.js +616 -0
  245. package/source/js/plugins/tags/contributors.js +92 -0
  246. package/source/js/plugins/tags/friends.js +93 -0
  247. package/source/js/plugins/tags/sites.js +96 -0
  248. package/source/js/search/hexo.js +180 -373
  249. package/.eslintrc.json +0 -111
  250. package/layout/_meta/valinecount.ejs +0 -15
  251. package/layout/_partial/rightmenu.ejs +0 -199
  252. package/layout/_partial/scripts/cover.ejs +0 -45
  253. package/layout/_partial/scripts/darkmode.ejs +0 -85
  254. package/layout/_partial/scripts/import.ejs +0 -3
  255. package/layout/_partial/scripts/issues.ejs +0 -18
  256. package/layout/_partial/scripts/search.ejs +0 -62
  257. package/layout/_partial/snackbar.ejs +0 -22
  258. package/layout/_third-party/aplayer/script.ejs +0 -26
  259. package/layout/_third-party/clipboard/script.ejs +0 -54
  260. package/layout/_third-party/comments/disqus/layout.ejs +0 -5
  261. package/layout/_third-party/comments/disqus/script.ejs +0 -90
  262. package/layout/_third-party/comments/disqusjs/layout.ejs +0 -1
  263. package/layout/_third-party/comments/disqusjs/script.ejs +0 -34
  264. package/layout/_third-party/comments/gitalk/layout.ejs +0 -1
  265. package/layout/_third-party/comments/gitalk/script.ejs +0 -22
  266. package/layout/_third-party/comments/hashover/layout.ejs +0 -2
  267. package/layout/_third-party/comments/hashover/script.ejs +0 -1
  268. package/layout/_third-party/comments/isso/layout.ejs +0 -1
  269. package/layout/_third-party/comments/isso/script.ejs +0 -1
  270. package/layout/_third-party/comments/livere/layout.ejs +0 -3
  271. package/layout/_third-party/comments/livere/script.ejs +0 -10
  272. package/layout/_third-party/comments/minivaline/layout.ejs +0 -3
  273. package/layout/_third-party/comments/minivaline/script.ejs +0 -34
  274. package/layout/_third-party/comments/twikoo/layout.ejs +0 -3
  275. package/layout/_third-party/comments/twikoo/script.ejs +0 -32
  276. package/layout/_third-party/comments/valine/layout.ejs +0 -3
  277. package/layout/_third-party/comments/valine/script.ejs +0 -49
  278. package/layout/_third-party/comments/vssue/layout.ejs +0 -1
  279. package/layout/_third-party/comments/vssue/script.ejs +0 -21
  280. package/layout/_third-party/comments/waline/layout.ejs +0 -3
  281. package/layout/_third-party/comments/waline/script.ejs +0 -33
  282. package/layout/_third-party/fancybox/script.ejs +0 -61
  283. package/layout/_third-party/highlightjs/script.ejs +0 -11
  284. package/layout/_third-party/pjax/index.ejs +0 -78
  285. package/layout/_third-party/pjax/pdata.ejs +0 -53
  286. package/layout/_third-party/scrollreveal/script.ejs +0 -21
  287. package/layout/_third-party/tidio/script.ejs +0 -3
  288. package/layout/artitalk.ejs +0 -13
  289. package/layout/bb.ejs +0 -10
  290. package/package-lock.json +0 -916
  291. package/scripts/tags/issues.js +0 -41
  292. package/scripts/z-lazyload/index.js +0 -4
  293. package/source/css/_highlight/index.styl +0 -316
  294. package/source/css/_layout/friends.styl +0 -79
  295. package/source/css/_plugins/clipboard.styl +0 -37
  296. package/source/css/_plugins/dark.styl +0 -149
  297. package/source/css/_plugins/darkmode.styl +0 -9
  298. package/source/css/_plugins/index.styl +0 -18
  299. package/source/css/_plugins/twikoo.styl +0 -21
  300. package/source/css/_plugins/valine.styl +0 -183
  301. package/source/css/_tag-plugins/simpleuser.styl +0 -21
  302. package/source/css/_tag-plugins/site-card.styl +0 -70
  303. package/source/js/aplayer.js +0 -167
  304. package/source/js/issues.js +0 -186
  305. package/source/js/search/algolia.js +0 -344
  306. package/source/js/search/azure.js +0 -355
  307. package/source/js/search/baidu.js +0 -340
  308. package/source/js/search/google.js +0 -339
  309. package/source/js/valine.js +0 -5137
@@ -1,90 +0,0 @@
1
- <script>
2
- const disqus_shortname = '<%= theme.comments.disqus.shortname %>';
3
- const autoload = '<%= theme.comments.disqus.autoload %>';
4
- const global_url = '<%= config.url %>'; // must use an absolute URL; relative URLs won’t work.
5
-
6
- function checkDisqus() {
7
- // 正在检查 Disqus 能否访问...
8
- const runcheck = (domain) => {
9
- return new Promise((resolve, reject) => {
10
- const img = new Image;
11
- const timeout = setTimeout(() => {
12
- img.onerror = img.onload = null;
13
- reject();
14
- }, 3000);
15
- img.onerror = () => {
16
- clearTimeout(timeout);
17
- reject();
18
- }
19
- img.onload = () => {
20
- clearTimeout(timeout);
21
- resolve();
22
- }
23
- img.src = `https://${domain}/favicon.ico?${+(new Date)}=${+(new Date)}`;
24
- })
25
- }
26
- return Promise.all([
27
- runcheck('<%= theme.comments.disqus.shortname %>.disqus.com')
28
- ]).then(loadDisqus,showError);
29
- }
30
-
31
- function loadDisqus() {
32
- let path = pdata.commentPath;
33
- if (path.length == 0) {
34
- let defaultPath = '<%= theme.comments.disqus.path %>';
35
- path = defaultPath || decodeURI(window.location.pathname);
36
- }
37
- if (window.DISQUS) {
38
- window.DISQUS.reset({
39
- reload: true,
40
- config() {
41
- this.page.identifier = global_url + path;
42
- this.page.url = global_url + path;
43
- }
44
- });
45
- } else {
46
- window.disqus_config = function () {
47
- this.page.url = global_url + path;
48
- this.page.identifier = global_url + path;
49
- };
50
- let d = document, s = d.createElement('script');
51
- s.async = true;
52
- s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
53
- s.setAttribute('data-timestamp', +new Date());
54
- (d.head || d.body).appendChild(s);
55
- }
56
- }
57
-
58
- // 加载错误
59
- function showError() {
60
- $('#loading-comments').hide();
61
- $('#notShowDisqus').show();
62
- }
63
-
64
- // 点击了加载
65
- function needLoadDisqus() {
66
- checkDisqus();
67
- $('#load-btns').hide();
68
- $('#loading-comments').show();
69
- }
70
-
71
- // pjax 重载
72
- function pjax_disqus() {
73
- // 排除当前页面不存在评论框的情形
74
- if ($('#disqus_thread').length == 0) {return}
75
- // 如果 DISQUS 已被实例化,则可直接加载
76
- if (window.DISQUS) {
77
- $('#load-btns').hide();
78
- $('#notShowDisqus').hide();
79
- $('#loading-comments').hide();
80
- loadDisqus();
81
- } else if (autoload == 'true') {
82
- // 设置自动加载但是上个页面加载失败了
83
- needLoadDisqus();
84
- }
85
- }
86
- if (autoload == 'true') {
87
- needLoadDisqus();
88
- }
89
- volantis.pjax.push(pjax_disqus);
90
- </script>
@@ -1 +0,0 @@
1
- <div id="disqus_thread"></div>
@@ -1,34 +0,0 @@
1
- <script>
2
- // from: https://github.com/ChrAlpha/hexo-theme-cards/blob/master/layout/_plugins/comments/disqusjs/source.ejs
3
- function loadDisqusJS() {
4
- loadScript('https://cdn.jsdelivr.net/npm/disqusjs@1.3/dist/disqus.js', pjax_DisqusJS)
5
- loadCSS('https://cdn.jsdelivr.net/npm/disqusjs@1.3/dist/disqusjs.css')
6
- }
7
- let path = pdata.commentPath;
8
- if (path.length == 0) {
9
- let defaultPath = '<%= theme.comments.disqusjs.path %>';
10
- path = defaultPath || decodeURI(window.location.pathname);
11
- }
12
- pjax_DisqusJS = () => {
13
- new DisqusJS(Object.assign(<%- JSON.stringify(theme.comments.disqusjs) %>, {
14
- siteName: '<%= config.title %>',
15
- url: '<%= page.permalink %>',
16
- identifier: path,
17
- }));
18
- };
19
- var runningOnBrowser = typeof window !== "undefined";
20
- var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro|msn)bot|crawl|spider|yand|duckgo/i.test(navigator.userAgent);
21
- var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
22
- if (!isBot && supportsIntersectionObserver) {
23
- var comment_observer = new IntersectionObserver(function(entries) {
24
- if (entries[0].isIntersecting) {
25
- loadDisqusJS();
26
- comment_observer.disconnect();
27
- }
28
- }, { threshold: [0] });
29
- comment_observer.observe(document.getElementById('comments'));
30
- } else {
31
- loadDisqusJS();
32
- }
33
- volantis.pjax.push(pjax_DisqusJS);
34
- </script>
@@ -1 +0,0 @@
1
- <div id="gitalk-container"></div>
@@ -1,22 +0,0 @@
1
- <script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
2
- <script type="text/javascript">
3
- function pjax_gitalk() {
4
- if(!document.querySelectorAll("#gitalk-container")[0])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(Object.assign(<%- JSON.stringify(theme.comments.gitalk) %>, {
12
- id: path,
13
- distractionFreeMode: false // Facebook-like distraction free mode
14
- }));
15
- gitalk.render('gitalk-container');
16
- }
17
- }
18
- $(function () {
19
- pjax_gitalk();
20
- });
21
- volantis.pjax.push(pjax_gitalk);
22
- </script>
@@ -1,2 +0,0 @@
1
- <p>未注册者输入用户名和密码登录即相当于注册,之后以同一用户名和密码登录可以编辑自己之前的评论。留邮箱可接收回复通知。支持全匿名评论。</p>
2
- <div id="hashover"></div>
@@ -1 +0,0 @@
1
- <script type="text/javascript" src="<%= theme.comments.hashover.src %>"></script>
@@ -1 +0,0 @@
1
- <div id="isso-thread"></div>
@@ -1 +0,0 @@
1
- <script data-isso="<%= theme.comments.isso.url %>" src="<%= theme.comments.isso.src %>"</script>
@@ -1,3 +0,0 @@
1
- <div id="lv-container" data-id="city" data-uid="<%= theme.comments.livere.uid %>">
2
- <noscript><div><i class='fas fa-exclamation-triangle'>&nbsp;<%- __('post.comments_placeholder', 'Livere') %></div></noscript>
3
- </div>
@@ -1,10 +0,0 @@
1
- <script type="text/javascript">
2
- (function(d, s) {
3
- var j, e = d.getElementsByTagName(s)[0];
4
- if (typeof LivereTower === 'function') { return; }
5
- j = d.createElement(s);
6
- j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
7
- j.async = true;
8
- e.parentNode.insertBefore(j, e);
9
- })(document, 'script');
10
- </script>
@@ -1,3 +0,0 @@
1
- <div id="minivaline_container">
2
- <i class="fas fa-cog fa-spin fa-fw fa-2x"></i>
3
- </div>
@@ -1,34 +0,0 @@
1
- <script>
2
- function load_minivaline() {
3
- <% if (theme.comments.minivaline.js) { %>
4
- loadScript('<%- theme.comments.minivaline.js %>', pjax_minivaline)
5
- <% } else { %>
6
- loadScript('https://cdn.jsdelivr.net/npm/minivaline@latest/dist/MiniValine.min.js', pjax_minivaline)
7
- <% } %>
8
- };
9
- function pjax_minivaline() {
10
- if(!document.querySelectorAll("#minivaline_container")[0])return;
11
- let pagePlaceholder = pdata.commentPlaceholder || "<%= theme.comments.minivaline.placeholder %>";
12
- let path = pdata.commentPath;
13
- if (path.length == 0) {
14
- let defaultPath = '<%= theme.comments.minivaline.path %>';
15
- path = defaultPath || decodeURI(window.location.pathname);
16
- }
17
- new MiniValine(Object.assign(<%- JSON.stringify(theme.comments.minivaline) %>, {
18
- el: '#minivaline_container',
19
- pathname: path,
20
- placeholder: pagePlaceholder,
21
- }));
22
- }
23
- $(function () {
24
- if(!document.querySelectorAll("#minivaline_container")[0])return;
25
- load_minivaline();
26
- });
27
- volantis.pjax.push(()=>{
28
- if (typeof MiniValine == "undefined") {
29
- load_minivaline();
30
- } else {
31
- pjax_minivaline();
32
- }
33
- },"MiniValine");
34
- </script>
@@ -1,3 +0,0 @@
1
- <div id="twikoo_container">
2
- <i class="fas fa-cog fa-spin fa-fw fa-2x"></i>
3
- </div>
@@ -1,32 +0,0 @@
1
- <script>
2
- function load_twikoo() {
3
- <% if (theme.comments.twikoo.js) { %>
4
- loadScript('<%- theme.comments.twikoo.js %>', pjax_twikoo)
5
- <% } else { %>
6
- loadScript('https://cdn.jsdelivr.net/npm/twikoo@latest', pjax_twikoo)
7
- <% } %>
8
- }
9
- function pjax_twikoo() {
10
- if(!document.querySelectorAll("#twikoo_container")[0])return;
11
- let path = pdata.commentPath;
12
- if (path.length == 0) {
13
- let defaultPath = '<%= theme.comments.twikoo.path %>';
14
- path = defaultPath || "decodeURI(window.location.pathname)"; //神奇的pathname
15
- }
16
- twikoo.init(Object.assign(<%- JSON.stringify(theme.comments.twikoo) %>, {
17
- el: '#twikoo_container',
18
- path: path,
19
- }))
20
- }
21
- $(function () {
22
- if(!document.querySelectorAll("#twikoo_container")[0])return;
23
- load_twikoo();
24
- });
25
- volantis.pjax.push(()=>{
26
- if (typeof twikoo == "undefined") {
27
- load_twikoo();
28
- } else {
29
- pjax_twikoo();
30
- }
31
- },'twikoo');
32
- </script>
@@ -1,3 +0,0 @@
1
- <div id="valine_container" class="valine_thread">
2
- <i class="fas fa-cog fa-spin fa-fw fa-2x"></i>
3
- </div>
@@ -1,49 +0,0 @@
1
- <% if (theme.comments.valine.js) { %>
2
- <%- js(theme.comments.valine.js) %>
3
- <% } else if(theme.use_cdn) { %>
4
- <%- js(['https://cdn.jsdelivr.net/npm/hexo-theme-volantis@'+theme.info.theme_version+'/source/js/valine.min.js']) %>
5
- <% } else { %>
6
- <%- js(['js/valine.js']) %>
7
- <% } %>
8
- <script>
9
- function emoji(path, idx, ext) {
10
- return path + "/" + path + "-" + idx + "." + ext;
11
- }
12
- var emojiMaps = {};
13
- for (var i = 1; i <= 54; i++) {
14
- emojiMaps['tieba-' + i] = emoji('tieba', i, 'png');
15
- }
16
- for (var i = 1; i <= 101; i++) {
17
- emojiMaps['qq-' + i] = emoji('qq', i, 'gif');
18
- }
19
- for (var i = 1; i <= 116; i++) {
20
- emojiMaps['aru-' + i] = emoji('aru', i, 'gif');
21
- }
22
- for (var i = 1; i <= 125; i++) {
23
- emojiMaps['twemoji-' + i] = emoji('twemoji', i, 'png');
24
- }
25
- for (var i = 1; i <= 4; i++) {
26
- emojiMaps['weibo-' + i] = emoji('weibo', i, 'png');
27
- }
28
- function pjax_valine() {
29
- if(!document.querySelectorAll("#valine_container")[0])return;
30
- let pagePlaceholder = pdata.commentPlaceholder || "<%= theme.comments.valine.placeholder %>";
31
- let path = pdata.commentPath;
32
- if (path.length == 0) {
33
- let defaultPath = '<%= theme.comments.valine.path %>';
34
- path = defaultPath || decodeURI(window.location.pathname);
35
- }
36
- var valine = new Valine();
37
- valine.init(Object.assign(<%- JSON.stringify(theme.comments.valine) %>, {
38
- el: '#valine_container',
39
- path: path,
40
- placeholder: pagePlaceholder,
41
- emojiCDN: 'https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
42
- emojiMaps: emojiMaps,
43
- }))
44
- }
45
- $(function () {
46
- pjax_valine();
47
- });
48
- volantis.pjax.push(pjax_valine);
49
- </script>
@@ -1 +0,0 @@
1
- <div id="vssue"></div>
@@ -1,21 +0,0 @@
1
- <script src="https://cdn.jsdelivr.net/gh/vuejs/vue@2.6.11/dist/vue.runtime.min.js"></script>
2
- <script src="https://cdn.jsdelivr.net/gh/meteorlxy/vssue@1.4.4/packages/vssue/dist/vssue.github.min.js"></script>
3
- <script>
4
- loadCSS("https://cdn.jsdelivr.net/gh/meteorlxy/vssue@1.4.4/packages/vssue/dist/vssue.min.css", window.volantis.loadcss);
5
- new Vue({
6
- el: '#vssue',
7
- render: h => h('Vssue', {
8
- props: {
9
- title: "<%- (page.seo_title || page.title) + ' - ' + config.title %>",
10
- options: {
11
- owner: '<%- theme.comments.vssue.owner %>',
12
- repo: '<%- theme.comments.vssue.repo %>',
13
- clientId: '<%- theme.comments.vssue.clientId %>',
14
- clientSecret: '<%- theme.comments.vssue.clientSecret %>',
15
- prefix: '',
16
- autoCreateIssue: true,
17
- },
18
- }
19
- })
20
- })
21
- </script>
@@ -1,3 +0,0 @@
1
- <div id="waline">
2
- <i class="fas fa-cog fa-spin fa-fw fa-2x"></i>
3
- </div>
@@ -1,33 +0,0 @@
1
- <% if (theme.comments.waline.js) { %>
2
- <%- js(theme.comments.waline.js) %>
3
- <% } else { %>
4
- <%- js(['https://cdn.jsdelivr.net/npm/@waline/client@latest']) %>
5
- <% }%>
6
- <script>
7
- function pjax_waline() {
8
- if(!document.querySelectorAll("#waline")[0])return;
9
- let pagePlaceholder = pdata.commentPlaceholder || "<%= theme.comments.waline.placeholder %>";
10
- let path = pdata.commentPath;
11
- if (path.length == 0) {
12
- let defaultPath = '<%= theme.comments.waline.path %>';
13
- path = defaultPath || decodeURI(window.location.pathname);
14
- }
15
- new Waline(Object.assign(<%- JSON.stringify(theme.comments.waline) %>, {
16
- el: '#waline',
17
- path: path,
18
- placeholder: pagePlaceholder,
19
- uploadImage: function(file) {
20
- const formData = new FormData();
21
- formData.append('image', file);
22
- return fetch('<%= theme.comments.waline.imageHosting %>', {
23
- method: 'POST',
24
- body: formData
25
- }).then(resp => resp.json()).then(resp => resp.data.url);
26
- },
27
- }));
28
- }
29
- $(function () {
30
- pjax_waline();
31
- });
32
- volantis.pjax.push(pjax_waline);
33
- </script>
@@ -1,61 +0,0 @@
1
- <script>
2
- function pjax_fancybox() {
3
- $(".md .gallery").find("img").each(function () { //渲染 fancybox
4
- var element = document.createElement("a"); // a 标签
5
- $(element).attr("class", "fancybox");
6
- $(element).attr("pjax-fancybox", ""); // 过滤 pjax
7
- $(element).attr("href", $(this).attr("src"));
8
- if ($(this).attr("data-original")) {
9
- $(element).attr("href", $(this).attr("data-original"));
10
- }
11
- $(element).attr("data-fancybox", "images");
12
- var caption = ""; // 描述信息
13
- if ($(this).attr('alt')) { // 判断当前页面是否存在描述信息
14
- $(element).attr('data-caption', $(this).attr('alt'));
15
- caption = $(this).attr('alt');
16
- }
17
- var div = document.createElement("div");
18
- $(div).addClass("fancybox");
19
- $(this).wrap(div); // 最外层套 div ,其实主要作用还是 class 样式
20
- var span = document.createElement("span");
21
- $(span).addClass("image-caption");
22
- $(span).text(caption); // 加描述
23
- $(this).after(span); // 再套一层描述
24
- $(this).wrap(element); // 最后套 a 标签
25
- })
26
- $(".md .gallery").find("img").fancybox({
27
- selector: '[data-fancybox="images"]',
28
- hash: false,
29
- loop: false,
30
- closeClick: true,
31
- helpers: {
32
- overlay: {closeClick: true}
33
- },
34
- buttons: [
35
- "zoom",
36
- "close"
37
- ]
38
- });
39
- };
40
- function SCload_fancybox() {
41
- if ($(".md .gallery").find("img").length == 0) return;
42
- loadCSS("https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css", document.getElementById("loadcss"));
43
- loadScript('https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js', pjax_fancybox)
44
- };
45
- $(function () {
46
- SCload_fancybox();
47
- });
48
- function Pjax_SCload_fancybox(){
49
- if (typeof $.fancybox == "undefined") {
50
- SCload_fancybox();
51
- } else {
52
- pjax_fancybox();
53
- }
54
- }
55
- volantis.pjax.push(Pjax_SCload_fancybox)
56
- volantis.pjax.send(()=>{
57
- if (typeof $.fancybox != "undefined") {
58
- $.fancybox.close(); // 关闭弹窗
59
- }
60
- },'fancybox')
61
- </script>
@@ -1,11 +0,0 @@
1
- <% if (theme.plugins.highlightjs.js) { %>
2
- <%- js(theme.plugins.highlightjs.js) %>
3
- <script>hljs.initHighlightingOnLoad();</script>
4
- <% } %>
5
- <script>
6
- volantis.pjax.push(()=>{
7
- document.querySelectorAll('pre code').forEach((block) => {
8
- hljs.highlightBlock(block);
9
- });
10
- },"highlightjs")
11
- </script>
@@ -1,78 +0,0 @@
1
- <%
2
- var banUrl = theme.plugins.pjax.banUrl || [];
3
- %>
4
-
5
- <%- js('https://cdn.jsdelivr.net/npm/pjax@0.2.8/pjax.min.js') %>
6
- <% if (theme.plugins.pjax.animation){ %>
7
- <%- partial('animate') %>
8
- <% } %>
9
- <script>
10
- var pjax;
11
- document.addEventListener('DOMContentLoaded', function () {
12
- pjax = new Pjax({
13
- elements: 'a[href]:not([href^="#"]):not([href="javascript:void(0)"]):not([pjax-fancybox])',
14
- selectors: [
15
- "title",
16
- <% if (!theme.plugins.pjax.cover){ %>"#l_cover",<% } %>
17
- "#pjax-container",
18
- "#pjax-header-nav-list"
19
- ],
20
- cacheBust: <%= theme.plugins.pjax.cacheBust %>, // url 地址追加时间戳,用以避免浏览器缓存
21
- timeout: <%= theme.plugins.pjax.timeout %>
22
- });
23
- });
24
-
25
- document.addEventListener('pjax:send', function (e) {
26
- //window.stop(); // 相当于点击了浏览器的停止按钮
27
-
28
- try {
29
- var currentUrl = window.location.pathname;
30
- var targetUrl = e.triggerElement.href;
31
- var banUrl = <%- '["' + banUrl.join('", "') + '"]' %>;
32
- if (banUrl[0] != "") {
33
- banUrl.forEach(item => {
34
- if(currentUrl.indexOf(item) != -1 || targetUrl.indexOf(item) != -1) {
35
- window.location.href = targetUrl;
36
- }
37
- });
38
- }
39
- } catch (error) {}
40
-
41
- window.subData = null; // 移除标题(用于一二级导航栏切换处)
42
-
43
- volantis.$switcher.removeClass('active'); // 关闭移动端激活的搜索框
44
- volantis.$header.removeClass('z_search-open'); // 关闭移动端激活的搜索框
45
- volantis.$wrapper.removeClass('sub'); // 跳转页面时关闭二级导航
46
-
47
- // 解绑事件 避免重复监听
48
- volantis.$topBtn.unbind('click');
49
- $('.menu a').unbind('click');
50
- $(window).unbind('resize');
51
- $(window).unbind('scroll');
52
- $(document).unbind('scroll');
53
- $(document).unbind('click');
54
- $('body').unbind('click');
55
- // 使用 volantis.pjax.send 方法传入pjax:send回调函数 参见layout/_partial/scripts/global.ejs
56
- volantis.pjax.method.send.start();
57
- });
58
-
59
- document.addEventListener('pjax:complete', function () {
60
- $('.nav-main').find('.list-v').not('.menu-phone').removeAttr("style",""); // 移除小尾巴的移除
61
- $('.menu-phone.list-v').removeAttr("style",""); // 移除小尾巴的移除
62
- $('script[data-pjax], .pjax-reload script').each(function () {
63
- $(this).parent().append($(this).remove());
64
- });
65
- try{
66
- // 使用 volantis.pjax.push 方法传入重载函数 参见layout/_partial/scripts/global.ejs
67
- volantis.pjax.method.complete.start();
68
- } catch (e) {
69
- console.log(e);
70
- }
71
- });
72
-
73
- document.addEventListener('pjax:error', function (e) {
74
- // 使用 volantis.pjax.error 方法传入pjax:error回调函数 参见layout/_partial/scripts/global.ejs
75
- volantis.pjax.method.error.start();
76
- window.location.href = e.triggerElement.href;
77
- });
78
- </script>
@@ -1,53 +0,0 @@
1
- <!--此文件用来存放一些不方便取值的变量-->
2
- <!--思路大概是将值藏到重加载的区域内-->
3
- <%
4
- var commentPath = ''; // 自定义的评论路径
5
- var commentPlaceholder = ''; // 自定义的评论描述
6
- var ispage = false; // 一二级导航栏切换控制
7
- var postTitle = ''; // 当前文章标题,用于二级导航栏赋值
8
- if (theme.comments.service && theme.comments.service.length > 0) {
9
- let service = theme.comments.service;
10
- if (page.comments == undefined || page.comments != false) {
11
- if (service in page) {
12
- if (page[service].path) {
13
- commentPath = page[service].path;
14
- }
15
- if (page[service].placeholder) {
16
- commentPlaceholder = page[service].placeholder;
17
- }
18
- }
19
- }
20
- }
21
- if (page && page.layout == 'post' && page.title) {
22
- ispage = true;
23
- postTitle = page.title;
24
- }
25
- %>
26
- <script>
27
- window.pdata={}
28
- pdata.ispage=<%=ispage%>;
29
- pdata.postTitle="<%=postTitle%>";
30
- pdata.commentPath="<%=commentPath%>";
31
- pdata.commentPlaceholder="<%=commentPlaceholder%>";
32
- // header 这里无论是否开启pjax都需要
33
- var l_header=document.getElementById("l_header");
34
- <% if (theme.pjax_cover.frontMatterCover == "none") {%>
35
- l_header.classList.add("show");
36
- <% } else {%>
37
- l_header.classList.remove("show");
38
- <% }%>
39
- <% if (theme.plugins.pjax.enable&&theme.plugins.pjax.cover) {%>
40
- // cover
41
- var cover_wrapper=document.querySelector('.cover-wrapper');
42
- <% if (theme.pjax_cover.frontMatterCover == "full") {%>
43
- cover_wrapper.id="full";
44
- cover_wrapper.style.display="";
45
- <% } else if (theme.pjax_cover.frontMatterCover == "half"){%>
46
- cover_wrapper.id="half";
47
- cover_wrapper.style.display="";
48
- <% } else if (theme.pjax_cover.frontMatterCover == "none"){%>
49
- cover_wrapper.id="none";
50
- cover_wrapper.style.display="none";
51
- <% }%>
52
- <% }%>
53
- </script>
@@ -1,21 +0,0 @@
1
- <script type="text/javascript">
2
- loadScript("<%- theme.plugins.scrollreveal.js %>")
3
- function pjax_scrollrebeal() {
4
- ScrollReveal().reveal('.l_main .reveal', {
5
- distance: '<%- theme.plugins.scrollreveal.distance %>',
6
- duration: '<%- theme.plugins.scrollreveal.duration %>',
7
- interval: '<%- theme.plugins.scrollreveal.interval %>',
8
- scale: '<%- theme.plugins.scrollreveal.scale %>',
9
- easing: 'ease-out'
10
- });
11
- }
12
- $(function () {
13
- var checkScrollReveal = setInterval(function () {
14
- if ($("#safearea").css("display")!="block") return
15
- if (typeof ScrollReveal=="undefined") return
16
- clearInterval(checkScrollReveal)
17
- pjax_scrollrebeal();
18
- }, 100)
19
- });
20
- volantis.pjax.push(pjax_scrollrebeal)
21
- </script>
@@ -1,3 +0,0 @@
1
- <% if (theme.plugins.tidio.enable) { %>
2
- <script src="//code.tidio.co/<%- theme.plugins.tidio.id %>.js" async></script>
3
- <% } %>
@@ -1,13 +0,0 @@
1
- <%- partial('_pre') %>
2
- <div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
3
- <%- partial('_partial/article', {post: page, index: false}) %>
4
- </div>
5
- <%- partial('_partial/side') %>
6
- <%- js(theme.plugins.jquery) %>
7
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/artitalk"></script>
8
- <script>
9
- new Artitalk(Object.assign(<%- JSON.stringify(theme.plugins.artitalk) %>, {}))
10
- </script>
11
- <style>
12
- #artitalk_main #lazy{background: transparent !important}
13
- </style>
package/layout/bb.ejs DELETED
@@ -1,10 +0,0 @@
1
- <%- partial('_pre') %>
2
- <div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
3
- <%- partial('_partial/article', {post: page, index: false}) %>
4
- </div>
5
- <%- partial('_partial/side') %>
6
- <%- js(theme.plugins.jquery) %>
7
- <script src='<%= theme.plugins.bbtalk.js %>'></script>
8
- <script>
9
- bbtalk.init(Object.assign(<%- JSON.stringify(theme.plugins.bbtalk) %>, {}))
10
- </script>