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,204 +0,0 @@
1
- <% if (theme.rightmenu.enable == true && theme.rightmenu.layout.length > 0) { %>
2
- <% function loadmenu(obj) { %>
3
- <li>
4
- <a class='vlts-menu fix-cursor-default' <%= obj.url ? 'href='+ url_for(obj.url)+'' : ''%>
5
- <% if (obj.rel) { %>
6
- rel="<%- obj.rel %>"
7
- <% } %>
8
- <% if (obj.target) { %>
9
- target="<%- obj.target %>"
10
- <% } %>
11
- <% if (obj.onclick) { %>
12
- onclick="<%- obj.onclick %>"
13
- <% } %>
14
- <% if (obj.id) { %>
15
- id="<%- obj.id %>"
16
- <% } else if (obj.url) { %>
17
- id="<%= url_for(obj.url).replace(/\/|%|\./g, "")?url_for(obj.url).replace(/\/|%|\./g, ""):"home" %>"
18
- <% } %>>
19
- <% if (obj.icon) { %><i class='<%= obj.icon %> fa-fw'></i><% } %> <%- obj.name %>
20
- </a>
21
- </li>
22
- <% } %>
23
-
24
- <div id="rightmenu-wrapper">
25
- <ul class="list-v rightmenu" id="rightmenu-content">
26
- <li class='option'>
27
- <a class='vlts-menu opt fix-cursor-default' id='menu-copy-text' onclick="document.execCommand('copy')"><i class='fa fa-copy fa-fw'></i><%- __('rightmenu.copy_text') %></a>
28
- <hr id='hr-text'>
29
- <a class='vlts-menu opt fix-cursor-default' id='menu-copy-href'><i class='fa fa-link fa-fw'></i><%- __('rightmenu.copy_link') %></a>
30
- <a class='vlts-menu opt fix-cursor-default' id='menu-open-href'><i class='fa fa-external-link-square-alt fa-fw'></i><%- __('rightmenu.open_in_new_tab') %></a>
31
- <hr id='hr-href'>
32
- <a class='vlts-menu opt fix-cursor-default' id='menu-copy-src'><i class='fa fa-image fa-fw'></i><%- __('rightmenu.copy_image_src') %></a>
33
- <hr id='hr-src'>
34
- </li>
35
- <% if (theme.plugins.fontawesome) { %>
36
- <li class='navigation'>
37
- <a class='nav icon-only fix-cursor-default' onclick='history.back()'><i class='fa fa-arrow-left fa-fw'></i></a>
38
- <a class='nav icon-only fix-cursor-default' onclick='history.forward()'><i class='fa fa-arrow-right fa-fw'></i></a>
39
- <a class='nav icon-only fix-cursor-default' onclick='window.location.reload()'><i class='fa fa-redo fa-fw'></i></a>
40
- <a class='nav icon-only fix-cursor-default' href='/'><i class='fa fa-home fa-fw'></i></a>
41
- </li>
42
- <% } else { %>
43
- <li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='history.back()'><i class='fa fa-arrow-left fa-fw'></i><%- __('rightmenu.back') %></a></li>
44
- <li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='history.forward()'><i class='fa fa-arrow-right fa-fw'></i><%- __('rightmenu.forward') %></a></li>
45
- <li class='option'><a class='vlts-menu opt fix-cursor-default' onclick='window.location.reload()'><i class='fa fa-redo fa-fw'></i><%- __('rightmenu.reload') %></a></li>
46
- <% } %>
47
- <hr>
48
- <% theme.rightmenu.layout.forEach(function(item){ %>
49
- <% if (item == 'hr') { %>
50
- <hr>
51
- <% } else if (item == 'music' && theme.plugins.aplayer.enable == true) { %>
52
- <li class='music name'>
53
- <p class='nav music-title fix-cursor-default'></p>
54
- </li>
55
- <li class='music ctrl'>
56
- <a class='nav icon-only backward fix-cursor-default' onclick='aplayerBackward()'><i class='fa fa-step-backward fa-fw'></i></a>
57
- <a class='nav icon-only toggle fix-cursor-default' onclick='aplayerToggle()'><i class='fa fa-play fa-fw'></i></a>
58
- <a class='nav icon-only forward fix-cursor-default' onclick='aplayerForward()'><i class='fa fa-step-forward fa-fw'></i></a>
59
- </li>
60
- <li class='music volume'>
61
- <a class='nav volume'>
62
- <div class="aplayer-volume-bar-wrap">
63
- <div class="aplayer-volume-bar fix-cursor-pointer">
64
- <div class="aplayer-volume"></div>
65
- <i class='left fa fa-volume-off fa-fw'></i>
66
- <i class='right fa fa-volume-up fa-fw'></i>
67
- </div>
68
- </div>
69
- </a>
70
- </li>
71
- <% } else if (item in theme.rightmenu) { %>
72
- <% loadmenu(theme.rightmenu[item]) %>
73
- <% } %>
74
- <% }) %>
75
- </ul>
76
- </div>
77
-
78
- <script>
79
- window.document.oncontextmenu = function (event) {
80
- if (event.ctrlKey) return true;
81
- if (/Android|webOS|BlackBerry/i.test(navigator.userAgent)) return true;
82
- return popMenu(event);
83
- };
84
- document.addEventListener("click", function (event) {
85
- var mymenu = document.getElementById('rightmenu-wrapper');
86
- mymenu.style.display = "none";
87
- });
88
- function popMenu(event) {
89
- var mymenu = document.getElementById('rightmenu-wrapper');
90
- var menuContent = document.getElementById('rightmenu-content');
91
- var screenWidth = document.documentElement.clientWidth || document.body.clientWidth;
92
- var screenHeight = document.documentElement.clientHeight || document.body.clientHeight;
93
- mymenu.style.left = event.clientX + "px"; // 获取鼠标位置
94
- mymenu.style.top = event.clientY + "px";
95
- mymenu.style.display = 'block';
96
- if (event.clientX * 2 > screenWidth) {
97
- menuContent.classList.add('left');
98
- } else {
99
- menuContent.classList.remove('left');
100
- }
101
- if (event.clientY * 2 > screenHeight) {
102
- menuContent.classList.add('top');
103
- } else {
104
- menuContent.classList.remove('top');
105
- }
106
-
107
- let hrText = document.getElementById('hr-text');
108
- let hrSrc = document.getElementById('hr-src');
109
- let hrHref = document.getElementById('hr-href');
110
-
111
- // 选中图片
112
- let copySrc = document.getElementById('menu-copy-src');
113
- if (copySrc != undefined) {
114
- if (event.target.currentSrc) {
115
- copySrc.style.display = 'block';
116
- copySrc.addEventListener("click", function (e) {
117
- copyString(event.target.currentSrc);
118
- },{once: true});
119
- hrSrc.style.display = 'block';
120
- } else {
121
- copySrc.style.display = 'none';
122
- hrSrc.style.display = 'none';
123
- }
124
- }
125
-
126
- // 选中按钮
127
- // 判断是不是按钮
128
- let href = '';
129
- if (event.path) {
130
- for (i = 0; i < event.path.length; i++) {
131
- if (event.path[i].href != undefined && event.path[i].href.length > 0) {
132
- href = event.path[i].href;
133
- }
134
- }
135
- }
136
-
137
- let copyText = document.getElementById('menu-copy-text');
138
- copyText.style.display = 'none';
139
- hrText.style.display = 'none';
140
- if (href.length == 0) {
141
- // 选中文本
142
- if (window.getSelection().toString()) {
143
- if ('<%= theme.plugins.clipboard.enable %>' == 'true') {
144
- copyText.style.display = 'block';
145
- hrText.style.display = 'block';
146
- }
147
- }
148
- }
149
-
150
- // 在新标签页打开
151
- let openHref = document.getElementById('menu-open-href');
152
- if (openHref != undefined) {
153
- if (href.length > 0) {
154
- openHref.style.display = 'block';
155
- openHref.addEventListener("click", function (e) {
156
- window.open(href);
157
- },{once: true});
158
- hrHref.style.display = 'block';
159
- } else {
160
- openHref.style.display = 'none';
161
- hrHref.style.display = 'none';
162
- }
163
- }
164
- // 复制链接
165
- let copyHref = document.getElementById('menu-copy-href');
166
- if (copyHref != undefined) {
167
- if (href.length > 0) {
168
- copyHref.style.display = 'block';
169
- copyHref.addEventListener("click", function (e) {
170
- copyString(href);
171
- },{once: true});
172
- } else {
173
- copyHref.style.display = 'none';
174
- }
175
- }
176
-
177
- // 有音乐播放器
178
- if ('<%= theme.plugins.aplayer.enable %>' == true && ('<%- theme.rightmenu.layout %>'||[]).includes('music')) {
179
- // 如果有aplayer,初始化一下
180
- try {
181
- checkAPlayer();
182
- updateTitle();
183
- } catch (error) {
184
- console.log(error);
185
- }
186
- }
187
-
188
- return false; // 该行代码确保系统自带的右键菜单不会被调出
189
- }
190
- function hideMenu() {
191
- document.getElementById('rightmenu-wrapper').style.display = 'none';
192
- }
193
- function copyString(str) {
194
- const input = document.createElement('input');
195
- input.setAttribute('readonly', 'readonly');
196
- document.body.appendChild(input);
197
- input.setAttribute('value', str);
198
- input.select();
199
- document.execCommand('copy');
200
- document.body.removeChild(input);
201
- }
202
- document.execCommand('click');
203
- </script>
204
- <% } %>
@@ -1,45 +0,0 @@
1
- <% if (theme.plugins.backstretch.enable && (theme.plugins.backstretch.images || page.images)) { %>
2
- <% var imgs = theme.plugins.backstretch.images || page.images; %>
3
- <% var posi = null;
4
- if (theme.plugins.backstretch.position == 'cover') {
5
- posi = '#cover-backstretch';
6
- }
7
- %>
8
- <% if (imgs != undefined && theme.plugins.backstretch.position != undefined){ %>
9
- <%- js(theme.plugins.backstretch.js) %>
10
- <script type="text/javascript">
11
- var imgs=<%- '["' + imgs.join('", "') + '"]' %>;
12
- if ('<%- theme.plugins.backstretch.shuffle %>' == 'true') {
13
- function shuffle(arr){
14
- /*From countercurrent-time*/
15
- var n = arr.length;
16
- while(n--) {
17
- var index = Math.floor(Math.random() * n);
18
- var temp = arr[index];
19
- arr[index] = arr[n];
20
- arr[n] = temp;
21
- }
22
- }
23
- shuffle(imgs);
24
- }
25
- function Pjax_backstretch(){
26
- <% if (posi) { %>
27
- $('<%- posi %>').backstretch(
28
- imgs,
29
- {
30
- duration: "<%- theme.plugins.backstretch.duration %>",
31
- fade: "<%- theme.plugins.backstretch.fade %>"
32
- });
33
- <%} else { %>
34
- $.backstretch(
35
- imgs,
36
- {
37
- duration: "<%- theme.plugins.backstretch.duration %>",
38
- fade: "<%- theme.plugins.backstretch.fade %>"
39
- });
40
- <%} %>
41
- }
42
- loadScript("<%- theme.plugins.backstretch.js %>",Pjax_backstretch)
43
- </script>
44
- <% } %>
45
- <% } %>
@@ -1,96 +0,0 @@
1
- <script>
2
- const rootElement = document.documentElement;
3
- const darkModeStorageKey = "user-color-scheme";
4
- const rootElementDarkModeAttributeName = "data-user-color-scheme";
5
-
6
- const setLS = (k, v) => {
7
- try {
8
- localStorage.setItem(k, v);
9
- } catch (e) {
10
- console.log(e.message);
11
- }
12
- };
13
-
14
- const removeLS = (k) => {
15
- try {
16
- localStorage.removeItem(k);
17
- } catch (e) {
18
- console.log(e.message);
19
- }
20
- };
21
-
22
- const getLS = (k) => {
23
- try {
24
- return localStorage.getItem(k);
25
- } catch (e) {
26
- console.log(e.message);
27
- return null;
28
- }
29
- };
30
-
31
- const getModeFromCSSMediaQuery = () => {
32
- return window.matchMedia("(prefers-color-scheme: dark)").matches
33
- ? "dark"
34
- : "light";
35
- };
36
-
37
- const resetRootDarkModeAttributeAndLS = () => {
38
- rootElement.removeAttribute(rootElementDarkModeAttributeName);
39
- removeLS(darkModeStorageKey);
40
- };
41
-
42
- const validColorModeKeys = {
43
- dark: true,
44
- light: true,
45
- };
46
-
47
- const applyCustomDarkModeSettings = (mode) => {
48
- const currentSetting = mode || getLS(darkModeStorageKey);
49
-
50
- if (currentSetting === getModeFromCSSMediaQuery()) {
51
- resetRootDarkModeAttributeAndLS();
52
- } else if (validColorModeKeys[currentSetting]) {
53
- rootElement.setAttribute(rootElementDarkModeAttributeName, currentSetting);
54
- } else {
55
- resetRootDarkModeAttributeAndLS();
56
- }
57
- };
58
-
59
- const invertDarkModeObj = {
60
- dark: "light",
61
- light: "dark",
62
- };
63
-
64
- /**
65
- * get target mode
66
- */
67
- const toggleCustomDarkMode = () => {
68
- let currentSetting = getLS(darkModeStorageKey);
69
-
70
- if (validColorModeKeys[currentSetting]) {
71
- currentSetting = invertDarkModeObj[currentSetting];
72
- } else if (currentSetting === null) {
73
- currentSetting = invertDarkModeObj[getModeFromCSSMediaQuery()];
74
- } else {
75
- return;
76
- }
77
- setLS(darkModeStorageKey, currentSetting);
78
- return currentSetting;
79
- };
80
-
81
- /**
82
- * bind click event for toggle button
83
- */
84
- function bindToggleButton() {
85
- var btn=$("#wrapper .toggle-mode-btn");
86
- btn.on('click',(e) => {
87
- const mode = toggleCustomDarkMode();
88
- applyCustomDarkModeSettings(mode);
89
- });
90
- }
91
-
92
- applyCustomDarkModeSettings();
93
- document.addEventListener("DOMContentLoaded", bindToggleButton);
94
- document.addEventListener("pjax:success", bindToggleButton);
95
-
96
- </script>
@@ -1,3 +0,0 @@
1
- <% (config.import.script||[]).forEach(function(item) { %>
2
- <%- item %>
3
- <% }) %>
@@ -1,72 +0,0 @@
1
- <script>
2
- window.volantis={};
3
- window.volantis.loadcss=document.getElementById("loadcss");
4
- /********************脚本懒加载函数********************************/
5
- function loadScript(src, cb) {
6
- var HEAD = document.getElementsByTagName('head')[0] || document.documentElement;
7
- var script = document.createElement('script');
8
- script.setAttribute('type','text/javascript');
9
- if (cb) script.onload = cb;
10
- script.setAttribute('src', src);
11
- HEAD.appendChild(script);
12
- }
13
- //https://github.com/filamentgroup/loadCSS
14
- var loadCSS = function( href, before, media, attributes ){
15
- var doc = window.document;
16
- var ss = doc.createElement( "link" );
17
- var ref;
18
- if( before ){
19
- ref = before;
20
- }
21
- else {
22
- var refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes;
23
- ref = refs[ refs.length - 1];
24
- }
25
- var sheets = doc.styleSheets;
26
- if( attributes ){
27
- for( var attributeName in attributes ){
28
- if( attributes.hasOwnProperty( attributeName ) ){
29
- ss.setAttribute( attributeName, attributes[attributeName] );
30
- }
31
- }
32
- }
33
- ss.rel = "stylesheet";
34
- ss.href = href;
35
- ss.media = "only x";
36
- function ready( cb ){
37
- if( doc.body ){
38
- return cb();
39
- }
40
- setTimeout(function(){
41
- ready( cb );
42
- });
43
- }
44
- ready( function(){
45
- ref.parentNode.insertBefore( ss, ( before ? ref : ref.nextSibling ) );
46
- });
47
- var onloadcssdefined = function( cb ){
48
- var resolvedHref = ss.href;
49
- var i = sheets.length;
50
- while( i-- ){
51
- if( sheets[ i ].href === resolvedHref ){
52
- return cb();
53
- }
54
- }
55
- setTimeout(function() {
56
- onloadcssdefined( cb );
57
- });
58
- };
59
- function loadCB(){
60
- if( ss.addEventListener ){
61
- ss.removeEventListener( "load", loadCB );
62
- }
63
- ss.media = media || "all";
64
- }
65
- if( ss.addEventListener ){
66
- ss.addEventListener( "load", loadCB);
67
- }
68
- ss.onloadcssdefined = onloadcssdefined;
69
- onloadcssdefined( loadCB );
70
- return ss;
71
- };
72
- </script>
@@ -1,62 +0,0 @@
1
- <script>
2
- const SearchServiceimagePath="https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@master/img/";
3
- const ROOT = ("<%- config.root %>" || "/").endsWith('/') ? ("<%- config.root %>" || "/") : ("<%- config.root %>/" || "/" );
4
-
5
- $('.input.u-search-input').one('focus',function(){
6
- <% if (theme.search.js) { %>
7
- loadScript('<%- theme.search.js %>',setSearchService);
8
- <% } else if(theme.use_cdn) { %>
9
- loadScript('<%- 'https://cdn.jsdelivr.net/npm/hexo-theme-volantis@'+theme.info.theme_version+'/source/js/search/'+theme.search.service+'.min.js' %>',setSearchService);
10
- <% } else { %>
11
- loadScript('<%- url_for('/js/search/'+theme.search.service+'.js') %>',setSearchService);
12
- <% } %>
13
- })
14
-
15
- function listenSearch(){
16
- <% if(theme.search.service === 'baidu') { %>
17
- const BAIDU_API_ID = "<%- theme.search.baidu.apiId %>";
18
- customSearch = new BaiduSearch({
19
- apiId: BAIDU_API_ID,
20
- imagePath: SearchServiceimagePath
21
- });
22
- <%} else if(theme.search.service === 'algolia') { %>
23
- const ALGOLIA_API_KEY = "<%- theme.search.algolia.apiKey %>";
24
- const ALGOLIA_APP_ID = "<%- theme.search.algolia.applicationID %>";
25
- const ALGOLIA_INDEX_NAME = "<%- theme.search.algolia.indexName %>";
26
- customSearch = new AlgoliaSearch({
27
- apiKey: ALGOLIA_API_KEY,
28
- appId: ALGOLIA_APP_ID,
29
- indexName: ALGOLIA_INDEX_NAME,
30
- imagePath: SearchServiceimagePath
31
- });
32
- <%} else if(theme.search.service === 'azure') { %>
33
- const AZURE_QUERY_KEY = "<%- theme.search.azure.queryKey %>";
34
- const AZURE_INDEX_NAME = "<%- theme.search.azure.indexName %>";
35
- const AZURE_SERVICE_NAME = "<%- theme.search.azure.serviceName %>";
36
- customSearch = new AzureSearch({
37
- serviceName: AZURE_SERVICE_NAME,
38
- indexName: AZURE_INDEX_NAME,
39
- queryKey: AZURE_QUERY_KEY,
40
- imagePath: SearchServiceimagePath
41
- });
42
- <%} else if(theme.search.service === 'google') { %>
43
- const GOOGLE_CUSTOM_SEARCH_API_KEY = "<%- theme.search.google.apiKey %>";
44
- const GOOGLE_CUSTOM_SEARCH_ENGINE_ID = "<%- theme.search.google.engineId %>";
45
- customSearch = new GoogleCustomSearch({
46
- apiKey: GOOGLE_CUSTOM_SEARCH_API_KEY,
47
- engineId: GOOGLE_CUSTOM_SEARCH_ENGINE_ID,
48
- imagePath: SearchServiceimagePath
49
- });
50
- <%} else {%>
51
- customSearch = new HexoSearch({
52
- imagePath: SearchServiceimagePath
53
- });
54
- <%}%>
55
- }
56
- function setSearchService() {
57
- listenSearch();
58
- <% if(theme.cover.layout_scheme=='search'){%>
59
- document.addEventListener("pjax:success", listenSearch);
60
- <% } %>
61
- }
62
- </script>
@@ -1,22 +0,0 @@
1
- <% let snackbar = site.data.notification[page.snackbar] %>
2
- <div class='snackbar-wrap' theme='<%- snackbar.theme %>'>
3
- <div class="snackbar-content">
4
- <div class='title'><%- markdown(snackbar.title) %></div>
5
- <div class='message'><%- markdown(snackbar.message) %></div>
6
- <% if (snackbar.action && snackbar.action.length > 0) { %>
7
- <div class="action">
8
- <% snackbar.action.forEach((ac, i) => { %>
9
- <% if (ac.dismiss) { %>
10
- <a onclick="document.getElementsByClassName('snackbar-wrap')[0].style.display = 'none'">
11
- <%- ac.title %>
12
- </a>
13
- <% } else { %>
14
- <a href='<%- ac.url %>'>
15
- <%- ac.title %>
16
- </a>
17
- <% } %>
18
- <% }) %>
19
- </div>
20
- <% } %>
21
- </div>
22
- </div>
@@ -1,24 +0,0 @@
1
- <% if (config.google_analytics_key) { %>
2
- <!-- Global site tag (gtag.js) - Google Analytics -->
3
- <!-- https://github.com/volantis-x/hexo-theme-volantis/issues/63 -->
4
- <script>
5
- setTimeout(function() {
6
- loadScript("https://www.googletagmanager.com/gtag/js?id=<%- config.google_analytics_key %>");
7
- window.dataLayer = window.dataLayer || [];
8
- function gtag(){dataLayer.push(arguments);}
9
- gtag('js', new Date());
10
- gtag('config', '<%- config.google_analytics_key %>');
11
- }, 5000);
12
- </script>
13
- <% } %>
14
- <% if (config.baidu_analytics_key) { %>
15
- <!-- baidu Analytics -->
16
- <script>
17
- var _hmt = _hmt || [];
18
- (function() {
19
- setTimeout(function() {
20
- loadScript("https://hm.baidu.com/hm.js?<%= config.baidu_analytics_key %>")
21
- }, 5000);
22
- })();
23
- </script>
24
- <% } %>
@@ -1,24 +0,0 @@
1
- <script>
2
- let APlayerController = new Object();
3
- APlayerController.id = '<%= theme.plugins.aplayer.id %>'; // 设定全局音乐播放ID
4
- APlayerController.volume = '<%= theme.plugins.aplayer.volume %>';
5
- loadCSS("https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css", window.volantis.loadcss);
6
- // APlayer 需要在 MetingJS 之前加载
7
- loadScript("<%- theme.plugins.aplayer.js.aplayer %>")
8
- window.volantis.LoadMetingJS=0
9
- var checkAPlayer = setInterval(function () {
10
- if (!window.APlayer) return
11
- clearInterval(checkAPlayer)
12
- if (!window.volantis.LoadMetingJS&&!window.MetingJSElement){
13
- window.LoadMetingJS=1
14
- loadScript("<%- theme.plugins.aplayer.js.meting %>")
15
- }
16
- }, 2500)
17
- <% if (theme.rightmenu.enable && theme.rightmenu.layout.includes('music')) { %>
18
- <% if(theme.use_cdn) { %>
19
- loadScript('https://cdn.jsdelivr.net/npm/hexo-theme-volantis@<%- theme.info.theme_version %>/source/js/aplayer.min.js');
20
- <% } else { %>
21
- loadScript("/js/aplayer.js")
22
- <% } %>
23
- <% } %>
24
- </script>
@@ -1,53 +0,0 @@
1
- <script src="<%- theme.plugins.clipboard.js %>"></script>
2
- <script>
3
- var clipboard = new ClipboardJS('.btn-copy', {
4
- target: function (trigger) {
5
- return trigger.nextElementSibling
6
- }
7
- });
8
- function wait(callback, seconds) {
9
- var timelag = null;
10
- timelag = window.setTimeout(callback, seconds)
11
- }
12
- function pjax_initCopyCode() {
13
- if($(".highlight .code pre").length+$(".article pre code").length==0)return;
14
- var copyHtml = '';
15
- copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
16
- copyHtml += '<i class="fas fa-copy"></i><span>COPY</span>';
17
- copyHtml += '</button>';
18
- $(".highlight .code pre").before(copyHtml);
19
- $(".article pre code").before(copyHtml);
20
- clipboard.off('success').on('success', function (e) {
21
- let $btn = $(e.trigger);
22
- $btn.addClass('copied');
23
- let $icon = $($btn.find('i'));
24
- $icon.removeClass('fa-copy');
25
- $icon.addClass('fa-check-circle');
26
- let $span = $($btn.find('span'));
27
- $span[0].innerText = 'COPIED';
28
- wait(function () {
29
- $icon.removeClass('fa-check-circle');
30
- $icon.addClass('fa-copy');
31
- $span[0].innerText = 'COPY'
32
- }, 2000)
33
- });
34
- clipboard.off('error').on('error', function (e) {
35
- e.clearSelection();
36
- let $btn = $(e.trigger);
37
- $btn.addClass('copy-failed');
38
- let $icon = $($btn.find('i'));
39
- $icon.removeClass('fa-copy');
40
- $icon.addClass('fa-times-circle');
41
- let $span = $($btn.find('span'));
42
- $span[0].innerText = 'COPY FAILED';
43
- wait(function () {
44
- $icon.removeClass('fa-times-circle');
45
- $icon.addClass('fa-copy');
46
- $span[0].innerText = 'COPY'
47
- }, 2000)
48
- })
49
- }
50
- $(function () {
51
- pjax_initCopyCode()
52
- });
53
- </script>
@@ -1,5 +0,0 @@
1
- <div id="disqus_thread">
2
- <div id="notShowDisqus" style="display: none;text-align: center;"><i class='fas fa-exclamation-triangle'></i>&nbsp;<%- __('post.comments_placeholder', 'Disqus') %></div>
3
- <div id="load-btns"><a class="load-comments" onclick="needLoadDisqus()"><%- __('post.comments_load', 'Disqus') %></a></div>
4
- <div id="loading-comments" style="display: none"><i class="fa fa-cog fa-spin fa-fw fa-2x"></i><br><%- __('post.comments_check', 'Disqus') %></div>
5
- </div>