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.
Files changed (302) hide show
  1. package/README.md +7 -5
  2. package/_config.yml +651 -234
  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 -2
  7. package/layout/_meta/author.ejs +4 -4
  8. package/layout/_meta/category.ejs +11 -8
  9. package/layout/_meta/counter.ejs +51 -2
  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/{valinecount.ejs → walinecount.ejs} +16 -15
  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 -13
  25. package/layout/_partial/categories.ejs +1 -1
  26. package/layout/_partial/cover.ejs +10 -30
  27. package/layout/_partial/footer.ejs +19 -11
  28. package/layout/_partial/head.ejs +70 -110
  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} +22 -26
  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 +423 -0
  37. package/layout/_partial/scripts/index.ejs +89 -73
  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/_plugins/analytics/script.ejs +74 -0
  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/_plugins/end-of-support/script.ejs +62 -0
  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/_plugins/nodewaves/script.ejs +12 -0
  80. package/layout/_plugins/parallax/script.ejs +74 -0
  81. package/layout/{_third-party → _plugins}/pjax/animate.ejs +31 -26
  82. package/layout/_plugins/pjax/index.ejs +73 -0
  83. package/layout/_plugins/pjax/pdata.ejs +56 -0
  84. package/layout/_plugins/preload/script.ejs +14 -0
  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 +40 -24
  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 +6 -2
  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 +35 -10
  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 +1 -1
  127. package/scripts/filters/replace.js +15 -0
  128. package/scripts/{z-lazyload/lib/process.js → filters/z-lazyload.js} +18 -15
  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} +9 -9
  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 +31 -26
  146. package/scripts/tags/btns.js +18 -13
  147. package/scripts/tags/checkbox.js +32 -22
  148. package/scripts/tags/contributors.js +100 -0
  149. package/scripts/tags/dropmenu.js +50 -35
  150. package/scripts/tags/fancybox.js +44 -10
  151. package/scripts/tags/folding.js +14 -9
  152. package/scripts/tags/frame.js +8 -3
  153. package/scripts/tags/friends.js +99 -0
  154. package/scripts/tags/ghcard.js +11 -6
  155. package/scripts/tags/image.js +18 -6
  156. package/scripts/tags/link.js +15 -10
  157. package/scripts/tags/md.js +59 -0
  158. package/scripts/tags/media.js +32 -8
  159. package/scripts/tags/note.js +41 -8
  160. package/scripts/tags/site.js +87 -51
  161. package/scripts/tags/span.js +16 -6
  162. package/scripts/tags/swiper.js +38 -0
  163. package/scripts/tags/table.js +1 -1
  164. package/scripts/tags/tabs.js +33 -3
  165. package/scripts/tags/timeline.js +9 -4
  166. package/source/css/Readme.md +28 -0
  167. package/source/css/_defines/AutoPrefixCSS.styl +347 -0
  168. package/source/css/_defines/Readme.md +3 -0
  169. package/source/css/_defines/color.styl +41 -1
  170. package/source/css/_defines/effect.styl +0 -13
  171. package/source/css/_defines/fonts.styl +17 -18
  172. package/source/css/_defines/func.styl +12 -30
  173. package/source/css/_first/base_first.styl +118 -0
  174. package/source/css/_first/{cover.styl → cover_first.styl} +113 -87
  175. package/source/css/_first/dark_first.styl +76 -0
  176. package/source/css/_first/fontfamily_first.styl +17 -0
  177. package/source/css/_first/{navbar.styl → navbar_first.styl} +4 -10
  178. package/source/css/_first/search_first.styl +12 -0
  179. package/source/css/{_base/index.styl → _style/_base/base.styl} +9 -93
  180. package/source/css/_style/_base/fontfamily_async.styl +8 -0
  181. package/source/css/{_layout → _style/_layout}/archive.styl +0 -0
  182. package/source/css/{_layout → _style/_layout}/article.styl +3 -30
  183. package/source/css/{_layout → _style/_layout}/footer.styl +0 -0
  184. package/source/css/_style/_layout/friends-simpleuser.styl +23 -0
  185. package/source/css/_style/_layout/friends-traditional.styl +81 -0
  186. package/source/css/{_layout → _style/_layout}/img.styl +0 -0
  187. package/source/css/_style/_layout/loading.styl +14 -0
  188. package/source/css/{_layout → _style/_layout}/main.styl +20 -7
  189. package/source/css/{_layout → _style/_layout}/md.styl +0 -0
  190. package/source/css/{_layout → _style/_layout}/pagination.styl +1 -1
  191. package/source/css/{_layout → _style/_layout}/posts.styl +2 -0
  192. package/source/css/{_first → _style/_layout}/search.styl +0 -103
  193. package/source/css/{_layout → _style/_layout}/sidebar.styl +23 -3
  194. package/source/css/{_layout → _style/_layout}/snackbar.styl +2 -1
  195. package/source/css/{_layout → _style/_layout}/toc.styl +3 -3
  196. package/source/css/{_layout → _style/_layout}/video.styl +0 -0
  197. package/source/css/_style/_plugins/_dark/dark_async.styl +41 -0
  198. package/source/css/_style/_plugins/_dark/dark_plugins.styl +136 -0
  199. package/source/css/_style/_plugins/_highlight/highlightjs/clipboard.styl +36 -0
  200. package/source/css/_style/_plugins/_highlight/highlightjs/color.styl +96 -0
  201. package/source/css/_style/_plugins/_highlight/highlightjs/index.styl +102 -0
  202. package/source/css/_style/_plugins/_highlight/highlightjs/language.styl +63 -0
  203. package/source/css/_style/_plugins/_highlight/index.styl +1 -0
  204. package/source/css/_style/_plugins/_highlight/prismjs/clipboard.styl +33 -0
  205. package/source/css/_style/_plugins/_highlight/prismjs/index.styl +8 -0
  206. package/source/css/_style/_plugins/_highlight/prismjs/language.styl +63 -0
  207. package/source/css/_style/_plugins/_rightmenu/reading.styl +56 -0
  208. package/source/css/{_plugins → _style/_plugins/_rightmenu}/rightmenu.styl +22 -2
  209. package/source/css/{_plugins → _style/_plugins}/aplayer.styl +11 -0
  210. package/source/css/{_plugins → _style/_plugins}/cursor.styl +49 -19
  211. package/source/css/_style/_plugins/fontcolor.styl +84 -0
  212. package/source/css/{_plugins → _style/_plugins}/gitalk.styl +0 -0
  213. package/source/css/_style/_plugins/index.styl +24 -0
  214. package/source/css/{_plugins → _style/_plugins}/mathjax.styl +0 -0
  215. package/source/css/_style/_plugins/message.styl +14 -0
  216. package/source/css/{_plugins → _style/_plugins}/pjaxanimate.styl +0 -0
  217. package/source/css/_style/_tag-plugins/Readme.md +6 -0
  218. package/source/css/{_tag-plugins → _style/_tag-plugins}/btns.styl +0 -0
  219. package/source/css/{_tag-plugins → _style/_tag-plugins}/checkbox.styl +0 -0
  220. package/source/css/{_tag-plugins → _style/_tag-plugins}/dropmenu.styl +0 -0
  221. package/source/css/{_plugins → _style/_tag-plugins}/fancybox.styl +8 -9
  222. package/source/css/{_tag-plugins → _style/_tag-plugins}/folding.styl +0 -0
  223. package/source/css/{_tag-plugins → _style/_tag-plugins}/frame.styl +0 -0
  224. package/source/css/_style/_tag-plugins/friends.styl +72 -0
  225. package/source/css/{_tag-plugins → _style/_tag-plugins}/ghcard.styl +0 -0
  226. package/source/css/{_tag-plugins → _style/_tag-plugins}/image.styl +0 -0
  227. package/source/css/{_tag-plugins → _style/_tag-plugins}/link.styl +0 -0
  228. package/source/css/{_tag-plugins → _style/_tag-plugins}/media.styl +0 -0
  229. package/source/css/{_tag-plugins → _style/_tag-plugins}/note.styl +0 -0
  230. package/source/css/_style/_tag-plugins/sites.styl +87 -0
  231. package/source/css/{_tag-plugins → _style/_tag-plugins}/span.styl +0 -0
  232. package/source/css/_style/_tag-plugins/swiper.styl +44 -0
  233. package/source/css/{_tag-plugins → _style/_tag-plugins}/table.styl +0 -0
  234. package/source/css/{_tag-plugins → _style/_tag-plugins}/tabs.styl +0 -0
  235. package/source/css/_style/_tag-plugins/tag.json +35 -0
  236. package/source/css/_style/_tag-plugins/text.styl +31 -0
  237. package/source/css/{_tag-plugins → _style/_tag-plugins}/timeline.styl +0 -0
  238. package/source/css/_style/index.styl +8 -0
  239. package/source/css/first.styl +17 -6
  240. package/source/css/style.styl +9 -7
  241. package/source/js/app.js +1128 -359
  242. package/source/js/plugins/aplayer.js +186 -0
  243. package/source/js/plugins/parallax.js +191 -0
  244. package/source/js/plugins/rightMenu.js +577 -0
  245. package/source/js/plugins/rightMenus.js +616 -0
  246. package/source/js/plugins/tags/contributors.js +92 -0
  247. package/source/js/plugins/tags/friends.js +93 -0
  248. package/source/js/plugins/tags/sites.js +96 -0
  249. package/source/js/search/hexo.js +180 -378
  250. package/layout/_partial/rightmenu.ejs +0 -204
  251. package/layout/_partial/scripts/cover.ejs +0 -45
  252. package/layout/_partial/scripts/darkmode.ejs +0 -96
  253. package/layout/_partial/scripts/import.ejs +0 -3
  254. package/layout/_partial/scripts/loadfunction.ejs +0 -72
  255. package/layout/_partial/scripts/search.ejs +0 -62
  256. package/layout/_partial/snackbar.ejs +0 -22
  257. package/layout/_third-party/analytics/script.ejs +0 -24
  258. package/layout/_third-party/aplayer/script.ejs +0 -24
  259. package/layout/_third-party/clipboard/script.ejs +0 -53
  260. package/layout/_third-party/comments/disqus/layout.ejs +0 -5
  261. package/layout/_third-party/comments/disqus/script.ejs +0 -93
  262. package/layout/_third-party/comments/gitalk/layout.ejs +0 -1
  263. package/layout/_third-party/comments/gitalk/script.ejs +0 -29
  264. package/layout/_third-party/comments/hashover/layout.ejs +0 -2
  265. package/layout/_third-party/comments/hashover/script.ejs +0 -1
  266. package/layout/_third-party/comments/isso/layout.ejs +0 -1
  267. package/layout/_third-party/comments/isso/script.ejs +0 -1
  268. package/layout/_third-party/comments/livere/layout.ejs +0 -3
  269. package/layout/_third-party/comments/livere/script.ejs +0 -10
  270. package/layout/_third-party/comments/minivaline/layout.ejs +0 -3
  271. package/layout/_third-party/comments/minivaline/script.ejs +0 -29
  272. package/layout/_third-party/comments/twikoo/layout.ejs +0 -3
  273. package/layout/_third-party/comments/twikoo/script.ejs +0 -17
  274. package/layout/_third-party/comments/valine/layout.ejs +0 -3
  275. package/layout/_third-party/comments/valine/script.ejs +0 -75
  276. package/layout/_third-party/comments/vssue/layout.ejs +0 -1
  277. package/layout/_third-party/comments/vssue/script.ejs +0 -22
  278. package/layout/_third-party/fancybox/script.ejs +0 -50
  279. package/layout/_third-party/issues/script.ejs +0 -15
  280. package/layout/_third-party/pjax/index.ejs +0 -143
  281. package/layout/_third-party/pjax/pdata.ejs +0 -47
  282. package/layout/_third-party/scrollreveal/script.ejs +0 -15
  283. package/layout/artitalk.ejs +0 -48
  284. package/scripts/tags/issues.js +0 -41
  285. package/scripts/z-lazyload/index.js +0 -4
  286. package/source/css/_highlight/index.styl +0 -316
  287. package/source/css/_layout/friends.styl +0 -79
  288. package/source/css/_plugins/clipboard.styl +0 -37
  289. package/source/css/_plugins/dark.styl +0 -149
  290. package/source/css/_plugins/darkmode.styl +0 -9
  291. package/source/css/_plugins/index.styl +0 -16
  292. package/source/css/_plugins/valine.styl +0 -173
  293. package/source/css/_tag-plugins/simpleuser.styl +0 -21
  294. package/source/css/_tag-plugins/site-card.styl +0 -70
  295. package/source/js/aplayer.js +0 -161
  296. package/source/js/issues.js +0 -186
  297. package/source/js/search/algolia.js +0 -348
  298. package/source/js/search/azure.js +0 -359
  299. package/source/js/search/baidu.js +0 -342
  300. package/source/js/search/google.js +0 -343
  301. package/source/js/twikoo.js +0 -13
  302. package/source/js/valine.js +0 -5265
@@ -1,93 +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
-
7
- function checkDisqus() {
8
- // 正在检查 Disqus 能否访问...
9
- const runcheck = (domain) => {
10
- return new Promise((resolve, reject) => {
11
- const img = new Image;
12
- const timeout = setTimeout(() => {
13
- img.onerror = img.onload = null;
14
- reject();
15
- }, 3000);
16
- img.onerror = () => {
17
- clearTimeout(timeout);
18
- reject();
19
- }
20
- img.onload = () => {
21
- clearTimeout(timeout);
22
- resolve();
23
- }
24
- img.src = `https://${domain}/favicon.ico?${+(new Date)}=${+(new Date)}`;
25
- })
26
- }
27
- return Promise.all([
28
- runcheck('<%= theme.comments.disqus.shortname %>.disqus.com')
29
- ]).then(loadDisqus,showError);
30
- }
31
-
32
- function loadDisqus() {
33
-
34
- let path = pdata.commentPath;
35
- if (path.length == 0) {
36
- let defaultPath = '<%= theme.comments.disqus.path %>';
37
- path = defaultPath || decodeURI(window.location.pathname);
38
- }
39
-
40
- if (window.DISQUS) {
41
- window.DISQUS.reset({
42
- reload: true,
43
- config() {
44
- this.page.identifier = global_url + path;
45
- this.page.url = global_url + path;
46
- }
47
- });
48
- } else {
49
- window.disqus_config = function () {
50
- this.page.url = global_url + path;
51
- this.page.identifier = global_url + path;
52
- };
53
- let d = document, s = d.createElement('script');
54
- s.async = true;
55
- s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
56
- s.setAttribute('data-timestamp', +new Date());
57
- (d.head || d.body).appendChild(s);
58
- }
59
- }
60
-
61
- // 加载错误
62
- function showError() {
63
- $('#loading-comments').hide();
64
- $('#notShowDisqus').show();
65
- }
66
-
67
- // 点击了加载
68
- function needLoadDisqus() {
69
- checkDisqus();
70
- $('#load-btns').hide();
71
- $('#loading-comments').show();
72
- }
73
-
74
- // pjax 重载
75
- function pjax_disqus() {
76
- // 排除当前页面不存在评论框的情形
77
- if ($('#disqus_thread').length == 0) {return}
78
- // 如果 DISQUS 已被实例化,则可直接加载
79
- if (window.DISQUS) {
80
- $('#load-btns').hide();
81
- $('#notShowDisqus').hide();
82
- $('#loading-comments').hide();
83
- loadDisqus();
84
- } else if (autoload == 'true') {
85
- // 设置自动加载但是上个页面加载失败了
86
- needLoadDisqus();
87
- }
88
- }
89
- if (autoload == 'true') {
90
- needLoadDisqus();
91
- }
92
-
93
- </script>
@@ -1 +0,0 @@
1
- <div id="gitalk-container"></div>
@@ -1,29 +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
-
6
- let path = pdata.commentPath;
7
- if (path.length == 0) {
8
- let defaultPath = '<%= theme.comments.gitalk.path %>';
9
- path = defaultPath || decodeURI(window.location.pathname);
10
- }
11
-
12
- if (document.getElementById('gitalk-container') != null) {
13
- var gitalk = new Gitalk({
14
- clientID: "<%- theme.comments.gitalk.clientID %>",
15
- clientSecret: "<%- theme.comments.gitalk.clientSecret %>",
16
- repo: "<%- theme.comments.gitalk.repo %>",
17
- owner: "<%- theme.comments.gitalk.owner %>",
18
- admin: "<%- theme.comments.gitalk.admin %>",
19
- id: path,
20
- distractionFreeMode: false // Facebook-like distraction free mode
21
- });
22
- gitalk.render('gitalk-container');
23
- }
24
- }
25
-
26
- $(function () {
27
- pjax_gitalk();
28
- });
29
- </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,29 +0,0 @@
1
- <script>
2
- function load_minivaline() {
3
- setTimeout(function() {
4
- <% if (theme.comments.minivaline.js) { %>
5
- loadScript('<%- theme.comments.minivaline.js %>', pjax_minivaline)
6
- <% } else { %>
7
- loadScript('https://cdn.jsdelivr.net/npm/minivaline@latest/dist/MiniValine.min.js', pjax_minivaline)
8
- <% } %>
9
- }, 1);
10
- };
11
- function pjax_minivaline() {
12
- if(!document.querySelectorAll("#minivaline_container")[0])return;
13
- let pagePlaceholder = pdata.commentPlaceholder || "<%= theme.comments.minivaline.placeholder %>";
14
- let path = pdata.commentPath;
15
- if (path.length == 0) {
16
- let defaultPath = '<%= theme.comments.minivaline.path %>';
17
- path = defaultPath || decodeURI(window.location.pathname);
18
- }
19
- new MiniValine(Object.assign(<%- JSON.stringify(theme.comments.minivaline) %>, {
20
- el: '#minivaline_container',
21
- pathname: path,
22
- placeholder: pagePlaceholder,
23
- }));
24
- }
25
- $(function () {
26
- if(!document.querySelectorAll("#minivaline_container")[0])return;
27
- load_minivaline();
28
- });
29
- </script>
@@ -1,3 +0,0 @@
1
- <div id="twikoo_container" class="valine_thread">
2
- <i class="fas fa-cog fa-spin fa-fw fa-2x"></i>
3
- </div>
@@ -1,17 +0,0 @@
1
- <% if (theme.comments.twikoo.js) { %>
2
- <%- js(theme.comments.twikoo.js) %>
3
- <% } else { %>
4
- <%- js(['js/twikoo.js']) %>
5
- <% } %>
6
- <script>
7
- function pjax_twikoo() {
8
- twikoo.init({ envId: '<%= theme.comments.twikoo.envId %>', el: '#twikoo_container' })
9
- }
10
-
11
- $(function () {
12
- pjax_twikoo();
13
- });
14
-
15
-
16
-
17
- </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,75 +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
- var GUEST_INFO = ['nick', 'mail', 'link'];
10
- var meta = '<%= theme.comments.valine.meta %>'.split(',').filter(function (item) {
11
- return GUEST_INFO.indexOf(item) > -1
12
- });
13
- var REQUIRED_FIELDS = ['nick', 'mail', 'link'];
14
- var requiredFields = '<%= theme.comments.valine.requiredFields %>'.split(',').filter(function (item) {
15
- return REQUIRED_FIELDS.indexOf(item) > -1
16
- });
17
-
18
- function emoji(path, idx, ext) {
19
- return path + "/" + path + "-" + idx + "." + ext;
20
- }
21
-
22
- var emojiMaps = {};
23
- for (var i = 1; i <= 54; i++) {
24
- emojiMaps['tieba-' + i] = emoji('tieba', i, 'png');
25
- }
26
- for (var i = 1; i <= 101; i++) {
27
- emojiMaps['qq-' + i] = emoji('qq', i, 'gif');
28
- }
29
- for (var i = 1; i <= 116; i++) {
30
- emojiMaps['aru-' + i] = emoji('aru', i, 'gif');
31
- }
32
- for (var i = 1; i <= 125; i++) {
33
- emojiMaps['twemoji-' + i] = emoji('twemoji', i, 'png');
34
- }
35
- for (var i = 1; i <= 4; i++) {
36
- emojiMaps['weibo-' + i] = emoji('weibo', i, 'png');
37
- }
38
-
39
- function pjax_valine() {
40
- if(!document.querySelectorAll("#valine_container")[0])return;
41
-
42
- let pagePlaceholder = pdata.commentPlaceholder || "<%= theme.comments.valine.placeholder %>";
43
-
44
- let path = pdata.commentPath;
45
- if (path.length == 0) {
46
- let defaultPath = '<%= theme.comments.valine.path %>';
47
- path = defaultPath || decodeURI(window.location.pathname);
48
- }
49
-
50
- var valine = new Valine();
51
- valine.init({
52
- el: '#valine_container',
53
- meta: meta,
54
- placeholder: pagePlaceholder,
55
- path: path,
56
- appId: "<%= theme.comments.valine.appId %>",
57
- appKey: "<%= theme.comments.valine.appKey %>",
58
- pageSize: '<%= theme.comments.valine.pageSize %>',
59
- avatar: '<%= theme.comments.valine.avatar %>',
60
- lang: '<%= theme.comments.valine.lang %>',
61
- visitor: '<%= theme.comments.valine.visitor %>',
62
- highlight: '<%= theme.comments.valine.highlight %>',
63
- mathJax: '<%= theme.comments.valine.mathJax %>',
64
- enableQQ: '<%= theme.comments.valine.enableQQ %>',
65
- recordIP: '<%= theme.comments.valine.recordIP %>',
66
- requiredFields: requiredFields,
67
- emojiCDN: 'https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/',
68
- emojiMaps: emojiMaps
69
- })
70
- }
71
-
72
- $(function () {
73
- pjax_valine();
74
- });
75
- </script>
@@ -1 +0,0 @@
1
- <div id="vssue"></div>
@@ -1,22 +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
-
8
- render: h => h('Vssue', {
9
- props: {
10
- title: "<%- (page.seo_title || page.title) + ' - ' + config.title %>",
11
- options: {
12
- owner: '<%- theme.comments.vssue.owner %>',
13
- repo: '<%- theme.comments.vssue.repo %>',
14
- clientId: '<%- theme.comments.vssue.clientId %>',
15
- clientSecret: '<%- theme.comments.vssue.clientSecret %>',
16
- prefix: '',
17
- autoCreateIssue: true,
18
- },
19
- }
20
- })
21
- })
22
- </script>
@@ -1,50 +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
- setTimeout(function() {
44
- loadScript('https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js', pjax_fancybox)
45
- }, 1);
46
- };
47
- $(function () {
48
- SCload_fancybox();
49
- });
50
- </script>
@@ -1,15 +0,0 @@
1
- <script>
2
- function loadIssuesJS() {
3
- if ($(".md").find(".issues-api").length == 0) return;
4
- setTimeout(function() {
5
- <% if(theme.use_cdn) { %>
6
- loadScript('https://cdn.jsdelivr.net/npm/hexo-theme-volantis@<%- theme.info.theme_version %>/source/js/issues.min.js');
7
- <% } else { %>
8
- loadScript('/js/issues.js');
9
- <% } %>
10
- }, 1);
11
- };
12
- $(function () {
13
- loadIssuesJS();
14
- });
15
- </script>
@@ -1,143 +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
- "#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
- if (typeof $.fancybox != "undefined") {
43
- $.fancybox.close(); // 关闭弹窗
44
- }
45
- volantis.$switcher.removeClass('active'); // 关闭移动端激活的搜索框
46
- volantis.$header.removeClass('z_search-open'); // 关闭移动端激活的搜索框
47
- volantis.$wrapper.removeClass('sub'); // 跳转页面时关闭二级导航
48
-
49
- // 解绑事件 避免重复监听
50
- volantis.$topBtn.unbind('click');
51
- $('.menu a').unbind('click');
52
- $(window).unbind('resize');
53
- $(window).unbind('scroll');
54
- $(document).unbind('scroll');
55
- $(document).unbind('click');
56
- $('body').unbind('click');
57
- <% if (theme.plugins.pjax.animation){ %>
58
- window.ShowLoading();
59
- <% } %>
60
- });
61
-
62
- document.addEventListener('pjax:complete', function () {
63
- // 关于百度统计对 SPA 页面的处理:
64
- // 方案一:百度统计>管理>单页应用设置中,打开开启按钮即可对SPA进行统计。 https://tongji.baidu.com/web/help/article?id=324
65
- // 方案二:取消注释下列代码。 https://tongji.baidu.com/web/help/article?id=235
66
- <% if (config.baidu_analytics_key) { %>
67
- _hmt.push(['_trackPageview', document.location.pathname]);
68
- <% } %>
69
-
70
- // 关于谷歌统计对 SPA 页面的处理:
71
- // 当应用以动态方式加载内容并更新地址栏中的网址时,也应该更新通过 gtag.js 存储的网页网址。
72
- // https://developers.google.cn/analytics/devguides/collection/gtagjs/single-page-applications?hl=zh-cn
73
- <% if (config.google_analytics_key) { %>
74
- window.dataLayer = window.dataLayer || [];
75
- function gtag(){dataLayer.push(arguments);}
76
- gtag('config', '<%- config.google_analytics_key %>', {'page_path': document.location.pathname});
77
- <% } %>
78
-
79
-
80
- $('.nav-main').find('.list-v').not('.menu-phone').removeAttr("style",""); // 移除小尾巴的移除
81
- $('.menu-phone.list-v').removeAttr("style",""); // 移除小尾巴的移除
82
- $('script[data-pjax], .pjax-reload script').each(function () {
83
- $(this).parent().append($(this).remove());
84
- });
85
- try{
86
- if (typeof $.fancybox == "undefined") {
87
- SCload_fancybox();
88
- } else {
89
- pjax_fancybox();
90
- }
91
- <% if (theme.plugins.backstretch.enable && theme.plugins.backstretch.images) { %>
92
- Pjax_backstretch()
93
- <% } %>
94
- <% if (theme.plugins.highlightjs.enable) { %>
95
- document.querySelectorAll('pre code').forEach((block) => {
96
- hljs.highlightBlock(block);
97
- });
98
- <% } %>
99
- <% if (theme.plugins.scrollreveal.enable) { %>
100
- pjax_scrollrebeal();
101
- <% } %>
102
- <% if (theme.plugins.issues.enable) { %>
103
- if (typeof IssuesAPI == "undefined") {
104
- loadIssuesJS();
105
- }
106
- <% } %>
107
- <% if (theme.plugins.clipboard.enable && (theme.custom_css.body.highlight.copy_btn == true)) { %>
108
- pjax_initCopyCode();
109
- <% } %>
110
- <% if (theme.comments.service == 'valine'){ %>
111
- pjax_valine();
112
- <% } %>
113
- <% if (theme.comments.service == 'minivaline'){ %>
114
- if (typeof MiniValine == "undefined") {
115
- load_minivaline();
116
- } else {
117
- pjax_minivaline();
118
- }
119
- <% } %>
120
- <% if (theme.comments.service == 'gitalk'){ %>
121
- pjax_gitalk();
122
- <% } %>
123
- <% if (theme.comments.service == 'disqus'){ %>
124
- pjax_disqus();
125
- <% } %>
126
- <% if (theme.comments.service == 'twikoo'){ %>
127
- pjax_twikoo();
128
- <% } %>
129
- } catch (e) {
130
- console.log(e);
131
- }
132
- <% if (theme.plugins.pjax.animation){ %>
133
- window.HideLoading();
134
- <% } %>
135
- });
136
-
137
- document.addEventListener('pjax:error', function (e) {
138
- <% if (theme.plugins.pjax.animation){ %>
139
- window.HideLoading();
140
- <% } %>
141
- window.location.href = e.triggerElement.href;
142
- });
143
- </script>
@@ -1,47 +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
- var enableValine = false;
22
- if (theme.comments.service == 'valine') {
23
- enableValine = true;
24
- }
25
- var enableMiniValine = false;
26
- if (theme.comments.service == 'minivaline') {
27
- enableMiniValine = true;
28
- }
29
- if (page && page.layout == 'post' && page.title) {
30
- ispage = true;
31
- postTitle = page.title;
32
- }
33
- %>
34
- <script>
35
- window.pdata={}
36
- pdata.ispage=<%=ispage%>;
37
- pdata.postTitle="<%=postTitle%>";
38
- pdata.commentPath="<%=theme.commentPath%>";
39
- pdata.commentPlaceholder="<%=commentPlaceholder%>";
40
-
41
- var l_header=document.getElementById("l_header");
42
- <% if (theme.pjax_cover.frontMatterCover == "none") {%>
43
- l_header.classList.add("show");
44
- <% } else {%>
45
- l_header.classList.remove("show");
46
- <% }%>
47
- </script>
@@ -1,15 +0,0 @@
1
- <script src="<%- theme.plugins.scrollreveal.js %>"></script>
2
- <script type="text/javascript">
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
- pjax_scrollrebeal();
14
- });
15
- </script>
@@ -1,48 +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
-
7
- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/artitalk"></script>
8
- <script>
9
- new Artitalk({
10
- appId: "<%= theme.plugins.artitalk.appId %>",
11
- appKey: "<%= theme.plugins.artitalk.appKey %>",
12
- <% if (theme.plugins.artitalk.serverURL) { %>
13
- serverURL: "<%= theme.plugins.artitalk.serverURL %>",
14
- <% } %>
15
- <% if (theme.plugins.artitalk.lang) { %>
16
- lang: "<%= theme.plugins.artitalk.lang %>",
17
- <% } %>
18
- <% if (theme.plugins.artitalk.pageSize) { %>
19
- pageSize: "<%= theme.plugins.artitalk.pageSize %>",
20
- <% } %>
21
- <% if (theme.plugins.artitalk.shuoPla) { %>
22
- shuoPla: "<%= theme.plugins.artitalk.shuoPla %>",
23
- <% } %>
24
- <% if (theme.plugins.artitalk.avatarPla) { %>
25
- avatarPla: "<%= theme.plugins.artitalk.avatarPla %>",
26
- <% } %>
27
- <% if (theme.plugins.artitalk.motion == 0) { %>
28
- motion: 0,
29
- <% } else { %>
30
- motion: 1,
31
- <% } %>
32
- <% if (theme.plugins.artitalk.bgImg) { %>
33
- bgImg: "<%= theme.plugins.artitalk.bgImg %>",
34
- <% } %>
35
- <% if (theme.plugins.artitalk.color1) { %>
36
- color1: "<%= theme.plugins.artitalk.color1 %>",
37
- <% } %>
38
- <% if (theme.plugins.artitalk.color2) { %>
39
- color2: "<%= theme.plugins.artitalk.color2 %>",
40
- <% } %>
41
- <% if (theme.plugins.artitalk.color3) { %>
42
- color3: "<%= theme.plugins.artitalk.color3 %>",
43
- <% } %>
44
- <% if (theme.plugins.artitalk.cssUrl) { %>
45
- cssUrl: "<%= theme.plugins.artitalk.cssUrl %>",
46
- <% } %>
47
- })
48
- </script>