hexo-theme-solitude 1.1.3 → 1.2.2

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 (254) hide show
  1. package/LICENSE +674 -19
  2. package/_config.yml +244 -193
  3. package/languages/en-US.yml +1 -0
  4. package/languages/zh-CN.yml +8 -8
  5. package/layout/404.pug +24 -0
  6. package/layout/archive.pug +11 -0
  7. package/layout/category.pug +16 -0
  8. package/layout/includes/console.pug +42 -0
  9. package/layout/includes/footer.pug +71 -0
  10. package/layout/includes/head/config.pug +79 -0
  11. package/layout/includes/head/pwa.pug +59 -0
  12. package/layout/includes/head.pug +29 -0
  13. package/layout/includes/header.pug +4 -0
  14. package/layout/includes/inject/body.pug +68 -0
  15. package/layout/{partial/compoment/inject/head.ejs → includes/inject/head.pug} +61 -35
  16. package/layout/includes/layout.pug +35 -0
  17. package/layout/{partial/loading.ejs → includes/loading.pug} +19 -17
  18. package/layout/includes/mixins/articleSort.pug +14 -0
  19. package/layout/includes/mixins/pagination.pug +8 -0
  20. package/layout/includes/nav.pug +22 -0
  21. package/layout/includes/page/about.pug +10 -0
  22. package/layout/includes/page/categories.pug +8 -0
  23. package/layout/includes/page/default.pug +2 -0
  24. package/layout/includes/page/echarts.pug +7 -0
  25. package/layout/includes/page/equipment.pug +3 -0
  26. package/layout/includes/page/links.pug +35 -0
  27. package/layout/includes/page/moments.pug +5 -0
  28. package/layout/includes/page/rss.pug +22 -0
  29. package/layout/includes/page/says.pug +20 -0
  30. package/layout/includes/page/tags.pug +8 -0
  31. package/layout/includes/page/tlink.pug +9 -0
  32. package/layout/includes/recent-posts.pug +9 -0
  33. package/layout/includes/sidebar.pug +17 -0
  34. package/layout/includes/widgets/aside/aside.pug +18 -0
  35. package/layout/includes/widgets/aside/asideAllInfo.pug +8 -0
  36. package/layout/includes/widgets/aside/asideArchive.pug +9 -0
  37. package/layout/includes/widgets/aside/asideFlipCard.pug +5 -0
  38. package/layout/includes/widgets/aside/asideHistory.pug +8 -0
  39. package/layout/includes/widgets/aside/asideInfoCard.pug +22 -0
  40. package/layout/includes/widgets/aside/asideNewestPost.pug +16 -0
  41. package/layout/includes/widgets/aside/asidePower.pug +19 -0
  42. package/layout/includes/widgets/aside/asideSwitch.pug +26 -0
  43. package/layout/includes/widgets/aside/asideTag.pug +11 -0
  44. package/layout/includes/widgets/aside/asideToc.pug +5 -0
  45. package/layout/includes/widgets/aside/asideWebInfo.pug +40 -0
  46. package/layout/includes/widgets/aside/asideWelcome.pug +12 -0
  47. package/layout/includes/widgets/home/banner.pug +16 -0
  48. package/layout/includes/widgets/home/bbTimeList.pug +8 -0
  49. package/layout/includes/widgets/home/categoryBar.pug +10 -0
  50. package/layout/includes/widgets/home/categoryGroup.pug +9 -0
  51. package/layout/includes/widgets/home/hometop.pug +9 -0
  52. package/layout/includes/widgets/home/postList.pug +26 -0
  53. package/layout/includes/widgets/home/rencentPost.pug +26 -0
  54. package/layout/includes/widgets/home/topGroup.pug +27 -0
  55. package/layout/includes/widgets/nav/left.pug +10 -0
  56. package/layout/includes/widgets/nav/menu.pug +16 -0
  57. package/layout/includes/widgets/nav/right.pug +23 -0
  58. package/layout/includes/widgets/page/about/authorinfo.pug +12 -0
  59. package/layout/includes/widgets/page/about/award.pug +34 -0
  60. package/layout/includes/widgets/page/about/contentinfo.pug +38 -0
  61. package/layout/includes/widgets/page/about/hobbies.pug +33 -0
  62. package/layout/includes/widgets/page/about/motto.pug +19 -0
  63. package/layout/includes/widgets/page/about/other.pug +61 -0
  64. package/layout/includes/widgets/page/about/personalities.pug +16 -0
  65. package/layout/includes/widgets/page/about/skillsinfo.pug +41 -0
  66. package/layout/includes/widgets/page/banner.pug +14 -0
  67. package/layout/includes/widgets/page/equipment/content.pug +23 -0
  68. package/layout/includes/widgets/page/links/banner.pug +30 -0
  69. package/layout/includes/widgets/page/links/linksCard.pug +18 -0
  70. package/layout/includes/widgets/page/links/linksItem.pug +14 -0
  71. package/layout/includes/widgets/page/moments/angle.pug +24 -0
  72. package/layout/includes/widgets/page/moments/index.pug +18 -0
  73. package/layout/includes/widgets/page/says/saysBottom.pug +11 -0
  74. package/layout/includes/widgets/page/says/saysContent.pug +6 -0
  75. package/layout/includes/widgets/page/says/saysFunction.pug +10 -0
  76. package/layout/includes/widgets/page/says/saysMeta.pug +7 -0
  77. package/layout/includes/widgets/post/award.pug +48 -0
  78. package/layout/includes/widgets/post/copyright.pug +27 -0
  79. package/layout/includes/widgets/post/postMeta.pug +55 -0
  80. package/layout/includes/widgets/post/postNav.pug +25 -0
  81. package/layout/includes/widgets/post/wave.pug +9 -0
  82. package/layout/includes/widgets/randomlink.pug +32 -0
  83. package/layout/includes/widgets/rightside/index.pug +74 -0
  84. package/layout/includes/widgets/third-party/comments/comment.pug +14 -0
  85. package/layout/includes/widgets/third-party/comments/gitalk.pug +0 -0
  86. package/layout/{partial/compoment/third-party/comments/twikoo.ejs → includes/widgets/third-party/comments/twikoo.pug} +8 -9
  87. package/layout/includes/widgets/third-party/comments/valine.pug +0 -0
  88. package/layout/includes/widgets/third-party/music.pug +3 -0
  89. package/layout/includes/widgets/third-party/pjax.pug +30 -0
  90. package/layout/includes/widgets/third-party/search/algolia-search.pug +14 -0
  91. package/layout/includes/widgets/third-party/search/index.pug +7 -0
  92. package/layout/includes/widgets/third-party/search/local-search.pug +13 -0
  93. package/layout/index.pug +20 -0
  94. package/layout/page.pug +32 -0
  95. package/layout/post.pug +43 -0
  96. package/layout/tag.pug +19 -0
  97. package/package.json +4 -4
  98. package/scripts/event/page.js +20 -2
  99. package/scripts/filter/checkThemeConfig.js +0 -1
  100. package/scripts/filter/randomPosts.js +0 -1
  101. package/scripts/helper/{charts.js → echarts.js} +27 -28
  102. package/scripts/helper/stylus.js +23 -0
  103. package/scripts/tags/bvideo.js +1 -36
  104. package/source/css/_comment/index.styl +121 -0
  105. package/source/css/_comment/twikoo.styl +515 -0
  106. package/source/css/_extra/console.styl +354 -0
  107. package/source/css/_extra/rightmenu.styl +83 -0
  108. package/source/css/_global/animation.css +756 -0
  109. package/source/css/_global/function.styl +83 -0
  110. package/source/css/_global/index.styl +120 -0
  111. package/source/css/_global/var.styl +1 -0
  112. package/source/css/_layout/articleSort.styl +199 -0
  113. package/source/css/_layout/base.styl +392 -0
  114. package/source/css/_layout/footer.styl +359 -0
  115. package/source/css/_layout/header.styl +1331 -0
  116. package/source/css/_layout/index.styl +293 -0
  117. package/source/css/_layout/sidebar.styl +226 -0
  118. package/source/css/_mode/index.styl +52 -0
  119. package/source/css/_page/about.styl +835 -0
  120. package/source/css/_page/category.styl +141 -0
  121. package/source/css/_page/equipment.styl +101 -0
  122. package/source/css/_page/error.styl +161 -0
  123. package/source/css/_page/home.styl +58 -0
  124. package/source/css/_page/homeTop.styl +1035 -0
  125. package/source/css/_page/index.styl +131 -0
  126. package/source/css/_page/link.styl +433 -0
  127. package/source/css/_page/moment.styl +179 -0
  128. package/source/css/_page/rss.styl +87 -0
  129. package/source/css/_page/says.styl +347 -0
  130. package/source/css/_page/tag.styl +56 -0
  131. package/source/css/_post/commentBarrage.styl +149 -0
  132. package/source/css/_post/externalTags.styl +694 -0
  133. package/source/css/_post/highlight.styl +96 -0
  134. package/source/css/_post/index.styl +935 -0
  135. package/source/css/_post/pagination.styl +467 -0
  136. package/source/css/_post/postContent.styl +957 -0
  137. package/source/css/_post/relatedPost.styl +160 -0
  138. package/source/css/_post/reward.styl +217 -0
  139. package/source/css/_search/algolia-search.styl +154 -0
  140. package/source/css/_search/local-search.styl +131 -0
  141. package/source/css/_widgets/aside/allinfo.styl +134 -0
  142. package/source/css/_widgets/aside/flip.styl +68 -0
  143. package/source/css/_widgets/aside/history.styl +35 -0
  144. package/source/css/_widgets/aside/index.styl +156 -0
  145. package/source/css/_widgets/aside/info.styl +263 -0
  146. package/source/css/_widgets/aside/newPost.styl +55 -0
  147. package/source/css/_widgets/aside/power.styl +90 -0
  148. package/source/css/_widgets/aside/toc.styl +85 -0
  149. package/source/css/_widgets/aside/welcome.styl +14 -0
  150. package/source/css/_widgets/index.styl +3 -0
  151. package/source/css/index.styl +40 -0
  152. package/source/js/commentBarrage.js +8 -5
  153. package/source/js/extend/console/comment.js +60 -63
  154. package/source/js/extend/covercolor/local.js +1 -1
  155. package/source/js/extend/search/algolia-search.js +151 -134
  156. package/source/js/extend/search/local-search.js +137 -162
  157. package/source/js/main.js +655 -505
  158. package/source/js/utils.js +168 -145
  159. package/layout/404.ejs +0 -34
  160. package/layout/archive.ejs +0 -10
  161. package/layout/category.ejs +0 -18
  162. package/layout/index.ejs +0 -20
  163. package/layout/layout.ejs +0 -30
  164. package/layout/page/about.ejs +0 -15
  165. package/layout/page/categories.ejs +0 -12
  166. package/layout/page/circle.ejs +0 -5
  167. package/layout/page/echarts.ejs +0 -1
  168. package/layout/page/equipment.ejs +0 -2
  169. package/layout/page/links.ejs +0 -46
  170. package/layout/page/page.ejs +0 -3
  171. package/layout/page/rss.ejs +0 -39
  172. package/layout/page/says.ejs +0 -17
  173. package/layout/page/tags.ejs +0 -12
  174. package/layout/page/tlink.ejs +0 -11
  175. package/layout/page.ejs +0 -45
  176. package/layout/partial/body.ejs +0 -7
  177. package/layout/partial/compoment/about/authorinfo.ejs +0 -18
  178. package/layout/partial/compoment/about/award.ejs +0 -59
  179. package/layout/partial/compoment/about/contentinfo.ejs +0 -33
  180. package/layout/partial/compoment/about/hobbies.ejs +0 -53
  181. package/layout/partial/compoment/about/motto.ejs +0 -17
  182. package/layout/partial/compoment/about/other.ejs +0 -76
  183. package/layout/partial/compoment/about/personalities.ejs +0 -11
  184. package/layout/partial/compoment/about/skillsinfo.ejs +0 -62
  185. package/layout/partial/compoment/aside/aside.ejs +0 -28
  186. package/layout/partial/compoment/aside/asideAllInfo.ejs +0 -6
  187. package/layout/partial/compoment/aside/asideArchive.ejs +0 -11
  188. package/layout/partial/compoment/aside/asideFlipCard.ejs +0 -72
  189. package/layout/partial/compoment/aside/asideHistory.ejs +0 -49
  190. package/layout/partial/compoment/aside/asideInfoCard.ejs +0 -39
  191. package/layout/partial/compoment/aside/asideNewestPost.ejs +0 -31
  192. package/layout/partial/compoment/aside/asidePower.ejs +0 -31
  193. package/layout/partial/compoment/aside/asideSwitch.ejs +0 -41
  194. package/layout/partial/compoment/aside/asideTag.ejs +0 -5
  195. package/layout/partial/compoment/aside/asideToc.ejs +0 -11
  196. package/layout/partial/compoment/aside/asideWebInfo.ejs +0 -60
  197. package/layout/partial/compoment/aside/asideWelcome.ejs +0 -33
  198. package/layout/partial/compoment/circle/angle.ejs +0 -26
  199. package/layout/partial/compoment/circle/banner.ejs +0 -11
  200. package/layout/partial/compoment/circle/content.ejs +0 -19
  201. package/layout/partial/compoment/dorakika/rightmenu.ejs +0 -100
  202. package/layout/partial/compoment/equipment/list.ejs +0 -37
  203. package/layout/partial/compoment/home/homeCategoryBar.ejs +0 -11
  204. package/layout/partial/compoment/home/postList.ejs +0 -37
  205. package/layout/partial/compoment/hometop/bbTimeList.ejs +0 -15
  206. package/layout/partial/compoment/hometop/categoryGroup.ejs +0 -19
  207. package/layout/partial/compoment/hometop/groupTag.ejs +0 -30
  208. package/layout/partial/compoment/hometop/topGroup.ejs +0 -41
  209. package/layout/partial/compoment/inject/body.ejs +0 -70
  210. package/layout/partial/compoment/links/angle.ejs +0 -26
  211. package/layout/partial/compoment/links/banner.ejs +0 -42
  212. package/layout/partial/compoment/links/linksCard.ejs +0 -27
  213. package/layout/partial/compoment/links/linksItem.ejs +0 -21
  214. package/layout/partial/compoment/mixins/articleSort.ejs +0 -26
  215. package/layout/partial/compoment/mixins/pagination.ejs +0 -11
  216. package/layout/partial/compoment/nav/left.ejs +0 -22
  217. package/layout/partial/compoment/nav/menu.ejs +0 -25
  218. package/layout/partial/compoment/nav/right.ejs +0 -42
  219. package/layout/partial/compoment/post/award.ejs +0 -60
  220. package/layout/partial/compoment/post/copyright.ejs +0 -39
  221. package/layout/partial/compoment/post/postMeta.ejs +0 -85
  222. package/layout/partial/compoment/post/postNav.ejs +0 -41
  223. package/layout/partial/compoment/post/wave.ejs +0 -14
  224. package/layout/partial/compoment/says/banner.ejs +0 -10
  225. package/layout/partial/compoment/says/saysBottom.ejs +0 -18
  226. package/layout/partial/compoment/says/saysContent.ejs +0 -10
  227. package/layout/partial/compoment/says/saysFunction.ejs +0 -15
  228. package/layout/partial/compoment/third-party/comments/comment.ejs +0 -12
  229. package/layout/partial/compoment/third-party/comments/twikoo_k.ejs +0 -29
  230. package/layout/partial/compoment/third-party/music.ejs +0 -5
  231. package/layout/partial/compoment/third-party/pjax.ejs +0 -31
  232. package/layout/partial/compoment/third-party/search/algolia-search.ejs +0 -20
  233. package/layout/partial/compoment/third-party/search/index.ejs +0 -10
  234. package/layout/partial/compoment/third-party/search/local-search.ejs +0 -22
  235. package/layout/partial/compoment/tlink/banner.ejs +0 -10
  236. package/layout/partial/console.ejs +0 -68
  237. package/layout/partial/footer.ejs +0 -109
  238. package/layout/partial/head.ejs +0 -37
  239. package/layout/partial/header.ejs +0 -6
  240. package/layout/partial/hometop.ejs +0 -15
  241. package/layout/partial/nav.ejs +0 -34
  242. package/layout/partial/pwa.ejs +0 -40
  243. package/layout/partial/sidebar.ejs +0 -31
  244. package/layout/post.ejs +0 -52
  245. package/layout/tag.ejs +0 -19
  246. package/scripts/helper/randomLinks.js +0 -16
  247. package/scripts/helper/themeJsExport.js +0 -79
  248. package/source/css/commentBarrage.css +0 -174
  249. package/source/css/custom.css +0 -901
  250. package/source/css/main.css +0 -16285
  251. package/source/css/search/algolia-search.css +0 -141
  252. package/source/css/search/local-search.css +0 -138
  253. package/source/css/var.css +0 -189
  254. /package/source/js/{rightmenu.js → rightside.js} +0 -0
@@ -0,0 +1,74 @@
1
+ div#rightMenu
2
+ div.rightMenu-group.rightMenu-small
3
+ div.rightMenu-item#menu-backward
4
+ i.scoicon.sco-arrow-left-line
5
+ div.rightMenu-item#menu-forward
6
+ i.scoicon.sco-arrow-right-line
7
+ div.rightMenu-item#menu-refresh
8
+ i.scoicon.sco-restart-line(style="font-size: 19px;")
9
+ div.rightMenu-item#menu-top
10
+ i.scoicon.sco-arrow-up-line
11
+ div.rightMenu-group.rightMenu-line.rightMenuPlugin
12
+ div.rightMenu-item#menu-copytext
13
+ i.scoicon.sco-copy-fill
14
+ span 复制选中文本
15
+ div.rightMenu-item#menu-pastetext
16
+ i.scoicon.sco-clipboard-fill
17
+ span 粘贴文本
18
+ a.rightMenu-item#menu-commenttext(data-pjax-state="")
19
+ i.scoicon.sco-chat-new-fill
20
+ span 引用到评论
21
+ div.rightMenu-item#menu-newwindow
22
+ i.scoicon.sco-window-fill
23
+ span 新窗口打开
24
+ div.rightMenu-item#menu-copylink
25
+ i.scoicon.sco-link-line
26
+ span 复制链接地址
27
+ div.rightMenu-item#menu-copyimg
28
+ i.scoicon.sco-copy-fill
29
+ span 复制此图片
30
+ div.rightMenu-item#menu-downloadimg
31
+ i.scoicon.sco-download-cloud-fill
32
+ span 下载此图片
33
+ div.rightMenu-item#menu-search
34
+ i.scoicon.sco-search-line
35
+ span 站内搜索
36
+ div.rightMenu-item#menu-searchBaidu
37
+ i.scoicon.sco-baidu-fill
38
+ span 百度搜索
39
+ div.rightMenu-item#menu-music-toggle
40
+ i.scoicon.sco-play-fill
41
+ span 播放音乐
42
+ div.rightMenu-item#menu-music-back
43
+ i.scoicon.sco-skip-back-fill
44
+ span 切换到上一首
45
+ div.rightMenu-item#menu-music-forward
46
+ i.scoicon.sco-skip-forward-fill
47
+ span 切换到下一首
48
+ div.rightMenu-item#menu-music-playlist(onclick=`window.open('${theme.thirdparty.aplayer.server === 'tencent' ? `https://y.qq.com/n/ryqq/playlist/${theme.thirdparty.aplayer.id}` : `https://music.163.com/#/playlist?id=${theme.thirdparty.aplayer.id}`}', '_blank');`)
49
+ i.scoicon.sco-play-list-2-line
50
+ span 查看所有歌曲
51
+ div.rightMenu-item#menu-music-copyMusicName
52
+ i.scoicon.sco-copy-fill
53
+ span 复制歌名
54
+ div.rightMenu-group.rightMenu-line.rightMenuOther
55
+ a.rightMenu-item.menu-Link#menu-randomPost(data-pjax-state="")
56
+ i.scoicon.sco-signal-tower-fill
57
+ span 随便逛逛
58
+ a.rightMenu-item.menu-link(href="/categories/", data-pjax-state="")
59
+ i.scoicon.sco-checkbox-multiple-blank-fill
60
+ span 博客分类
61
+ a.rightMenu-item.menu-link(href="/tags/", data-pjax-state="")
62
+ i.scoicon.sco-price-tag-fill
63
+ span 文章标签
64
+ div.rightMenu-group.rightMenu-line.rightMenuOther
65
+ div.rightMenu-item#menu-copy
66
+ i.scoicon.sco-external-link-fill
67
+ span 复制地址
68
+ div.rightMenu-item#menu-commentBarrage
69
+ i.scoicon.sco-chat-fill
70
+ span.menu-commentBarrage-text 关闭热评
71
+ div.rightMenu-item#menu-darkmode
72
+ i.scoicon.sco-moon-clear-fill
73
+ span.menu-darkmode-text 浅色模式
74
+ div#rightmenu-mask
@@ -0,0 +1,14 @@
1
+ div#post-comment(view-image)
2
+ .comment-head
3
+ .comment-headline
4
+ i.scoicon.sco-chat-fill
5
+ span 评论
6
+ .comment-wrap
7
+ #comment
8
+ case theme.comment.type
9
+ when 'twikoo'
10
+ include ./twikoo.pug
11
+ when 'gitalk'
12
+ include ./gitalk.pug
13
+ when 'valine'
14
+ include ./valine.pug
@@ -1,19 +1,19 @@
1
- <script>
1
+ script.
2
2
  async function initComment(){
3
3
  var initOptions = Object.assign(
4
- <%- JSON.stringify(theme.comment.twikoo || {}) %>,
4
+ !{JSON.stringify(theme.comment.twikoo || {})},
5
5
  {
6
6
  el: '#comment',
7
7
  onCommentLoaded: function() {
8
- GLOBALCONFIG.lightbox && sco.lightbox('#article-container img, #twikoo .tk-content img:not(.tk-owo-emotion)')
8
+ GLOBAL_CONFIG.lightbox && sco.lightbox('#article-container img, #twikoo .tk-content img:not(.tk-owo-emotion)')
9
9
  },
10
- lang: '<%= theme.comment.twikoo.lang %>',
10
+ lang: '#{theme.comment.twikoo.lang}',
11
11
  }
12
12
  )
13
13
  await twikoo.init(initOptions)
14
- <% if(theme.post.meta.comment && is_post()){ %>
14
+ if (#{theme.post.meta.comment && is_post()}) {
15
15
  var countOptions = Object.assign(
16
- <%- JSON.stringify(theme.comment.twikoo || {}) %>,
16
+ !{JSON.stringify(theme.comment.twikoo || {})},
17
17
  {
18
18
  urls: [window.location.pathname],
19
19
  includeReply: false
@@ -25,6 +25,5 @@
25
25
  }catch (e) {
26
26
  document.getElementById('twikoo-count').innerText = '加载错误'
27
27
  }
28
- <% } %>
29
- }
30
- </script>
28
+ }
29
+ }
@@ -0,0 +1,3 @@
1
+ div.needEndHide#nav-music(onclick="sco.musicToggle()")
2
+ div#nav-music-hoverTips= "音乐已暂停"
3
+ meting-js(id=theme.thirdparty.aplayer.id, server=theme.thirdparty.aplayer.server, type="playlist", mutex="true", preload="none", data-lrctype="0", order="random", theme="var(--sco-main)")
@@ -0,0 +1,30 @@
1
+ script.
2
+ let pjaxSelectors = [
3
+ 'title',
4
+ '#body-wrap',
5
+ '#site-config',
6
+ 'meta[name="description"]',
7
+ '#js-pjax'
8
+ ]
9
+
10
+ const pjax = new Pjax({
11
+ elements: 'a:not([target="_blank"])',
12
+ selectors: pjaxSelectors,
13
+ cacheBust: false,
14
+ analytics: false,
15
+ scrollRestoration: false
16
+ })
17
+
18
+ document.querySelectorAll('script[data-pjax]').forEach(item => {
19
+ const newScript = document.createElement('script')
20
+ const content = item.text || item.textContent || item.innerHTML || ""
21
+ Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
22
+ newScript.appendChild(document.createTextNode(content))
23
+ item.parentNode.replaceChild(newScript, item)
24
+ })
25
+
26
+ document.addEventListener('pjax:error', (e) => {
27
+ if (e.request.status === 404) {
28
+ pjax.loadUrl('/404.html')
29
+ }
30
+ })
@@ -0,0 +1,14 @@
1
+ div#algolia-search
2
+ div.search-dialog
3
+ div.search-dialog__title#algolia-search-title= "搜索"
4
+ div#algolia-input-panel
5
+ div#algolia-search-input
6
+ div#search-results
7
+ div#algolia-hits
8
+ div#algolia-tips
9
+ div#algolia-pagination
10
+ div#algolia-stats
11
+ #algolia-poweredBy
12
+ span.search-close-button
13
+ i.scoicon.sco-close-fill
14
+ div#search-mask
@@ -0,0 +1,7 @@
1
+ if theme.thirdparty.search.enable
2
+ if theme.thirdparty.search.type==="algolia"
3
+ include ./algolia-search.pug
4
+ script(src="/js/extend/search/algolia-search.js")
5
+ else if theme.thirdparty.search.type === "local"
6
+ include ./local-search.pug
7
+ script(src="/js/extend/search/local-search.js")
@@ -0,0 +1,13 @@
1
+ div#local-search
2
+ div.search-dialog
3
+ nav.search-nav
4
+ span.search-dialog-title 搜索
5
+ button.search-close-button
6
+ i.scoicon.sco-close-fill
7
+ div.search-wrap
8
+ div.search-box
9
+ input.search-box-input(type="text", id="search-input", autocomplete="off", spellcheck="false", autocorrect="off", autocapitalize="off", placeholder=__('search.placeholder'))
10
+ div#search-results
11
+ div#search-pagination
12
+ div#search-tips
13
+ div#search-mask
@@ -0,0 +1,20 @@
1
+ extends includes/layout.pug
2
+
3
+ block content
4
+ div#home_top
5
+ if(theme.says.home_mini)
6
+ include ./includes/widgets/home/bbTimeList.pug
7
+ if(theme.hometop.banner.enable)
8
+ include ./includes/widgets/home/hometop.pug
9
+ main(class="layout", id="content-inner")
10
+ div(class="recent-posts", id="recent-posts")
11
+ div#category-bar
12
+ include ./includes/widgets/home/categoryBar.pug
13
+
14
+ include ./includes/widgets/home/postList.pug
15
+
16
+ // pageination
17
+ include ./includes/mixins/pagination.pug
18
+
19
+ // aside
20
+ include ./includes/widgets/aside/aside.pug
@@ -0,0 +1,32 @@
1
+ extends includes/layout.pug
2
+
3
+ block content
4
+ main.layout(class=page.aside ? '' : 'hide-aside', id='content-inner')
5
+ div#page
6
+ case page.type
7
+ when 'categories'
8
+ include includes/page/categories
9
+ when 'tags'
10
+ include includes/page/tags
11
+ when 'links'
12
+ include includes/page/links
13
+ when 'tlink'
14
+ include includes/page/tlink
15
+ when 'about'
16
+ include includes/page/about
17
+ when 'says'
18
+ include includes/page/says
19
+ when 'equipment'
20
+ include includes/page/equipment
21
+ when 'moments'
22
+ include includes/page/moments
23
+ when 'echarts'
24
+ include includes/page/echarts
25
+ when 'rss'
26
+ include includes/page/rss
27
+ default
28
+ include includes/page/default
29
+ if page.comment
30
+ include includes/widgets/third-party/comments/comment
31
+ if page.aside
32
+ include includes/widgets/aside/aside
@@ -0,0 +1,43 @@
1
+ extends includes/layout.pug
2
+
3
+ block content
4
+ main.layout#content-inner
5
+ #post
6
+ article.post-content#article-container!= page.content
7
+ include includes/widgets/post/copyright
8
+ .post-tools-right
9
+ .tag_share
10
+ .post-meta__tag-list
11
+ each data in page.tags.data
12
+ a(href=url_for(data.path)).post-meta__tags
13
+ span.tags-punctuation
14
+ | #{data.name}
15
+ span.tagsPageCount #{data.length}
16
+ if site.posts.length > 1
17
+ include includes/widgets/post/postNav
18
+ != related_posts(page, site.posts)
19
+ if page.comment
20
+ include includes/widgets/third-party/comments/comment
21
+ include includes/widgets/aside/aside
22
+ if theme.thirdparty.ai.enable
23
+ - let ai_black_list = theme.thirdparty.ai.BlackWhite_List.mode === 'black' ? theme.thirdparty.ai.BlackWhite_List.List.map(item => `'${item}'`).join(', ') : '';
24
+ - let ai_white_list = theme.thirdparty.ai.BlackWhite_List.mode === 'white' ? theme.thirdparty.ai.BlackWhite_List.List.map(item => `'${item}'`).join(', ') : '';
25
+ script(data-pjax, defer).
26
+ new ChucklePostAI({
27
+ el: '#post #article-container',
28
+ key: '#{theme.thirdparty.ai.key}',
29
+ title_el: '.post-title',
30
+ rec_method: '#{theme.thirdparty.ai.rec_method || 'web'}',
31
+ interface: {
32
+ name: "#{theme.thirdparty.ai.ai_name || 'Solitude AI'}",
33
+ introduce: "#{theme.thirdparty.ai.ai_introduce || '我是文章辅助AI生成工具: Solitude AI。你可以点击下方的按钮,让我生成本文简介、推荐相关文章等。'}",
34
+ version: "#{theme.thirdparty.ai.ai_tips || 'GPT 4'}",
35
+ },
36
+ hide_shuttle: !{!!theme.thirdparty.ai.hide_shuttle},
37
+ typewriter: !{!!theme.thirdparty.ai.typewriter},
38
+ speed: !{!!theme.thirdparty.ai.speed},
39
+ eliminate: [!{ai_black_list}],
40
+ whitelist: [!{ai_white_list}],
41
+ total_length: !{page.ai_total_length ? page.ai_total_length : 0},
42
+ ratio_string: !{page.ai_ratio_string ? page.ai_ratio_string : 0},
43
+ })
package/layout/tag.pug ADDED
@@ -0,0 +1,19 @@
1
+ extends includes/layout.pug
2
+
3
+ block content
4
+ main.layout#content-inner
5
+ div#tag
6
+ div#tag-page-tags
7
+ each tag in site.tags.find({ parent: { $exists: false } }).data
8
+ a(id=tag.name class=(tag.name === page.tag ? 'select' : '') href=url_for(tag.path))
9
+ span.tags-punctuation
10
+ | #{tag.name}
11
+ span.tagsPageCount #{tag.length}
12
+ div.recent-posts#recent-posts
13
+ - const currentTag = page.tag
14
+ each post in site.posts.data
15
+ each tag in post.tags.data
16
+ if tag.name === currentTag
17
+ include includes/widgets/home/postList
18
+ include includes/mixins/pagination
19
+ include includes/widgets/aside/aside
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.1.3",
3
+ "version": "1.2.2",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the DuoSco team",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -14,10 +14,10 @@
14
14
  "theme",
15
15
  "hexo-theme-solitude"
16
16
  ],
17
- "author": "Hexo-Theme-Solitude<admin@wzsco.top>",
18
- "license": "MIT",
17
+ "author": "Hexo-Theme-Solitude<wzsco@qq.com>",
18
+ "license": "GNU",
19
19
  "bugs": {
20
20
  "url": "https://github.com/DuoSco/Hexo-theme-solitude/issues"
21
21
  },
22
22
  "homepage": "https://github.com/DuoSco/hexo-theme-solitude#readme"
23
- }
23
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  hexo.extend.generator.register('404', function (locals) {
2
3
  if(!this.theme.config.page.error)return
3
4
  return {
@@ -14,11 +15,12 @@ hexo.extend.generator.register('404', function (locals) {
14
15
  // generate tags Page
15
16
  hexo.extend.generator.register('tags', function(locals) {
16
17
  if(!this.theme.config.page.tags)return
18
+ const lang = hexo.theme.i18n.get(this.config.language || 'zh-CN')
17
19
  return {
18
20
  path: 'tags/index.html',
19
21
  layout: ['page'],
20
22
  data: {
21
- title: 'tags',
23
+ title: lang["page.tag"],
22
24
  type: 'tags',
23
25
  comment: false
24
26
  }
@@ -28,13 +30,29 @@ hexo.extend.generator.register('tags', function(locals) {
28
30
  // generate categories Page
29
31
  hexo.extend.generator.register('categories', function(locals) {
30
32
  if(!this.theme.config.page.categories)return
33
+ const lang = hexo.theme.i18n.get(this.config.language || 'zh-CN')
31
34
  return {
32
35
  path: 'categories/index.html',
33
36
  layout: ['page'],
34
37
  data: {
35
- title: 'categories',
38
+ title: lang["page.category"],
36
39
  type: 'categories',
37
40
  comment: false
38
41
  }
39
42
  };
40
43
  });
44
+
45
+ // generate echarts Page
46
+ hexo.extend.generator.register('echarts', function(locals) {
47
+ if(!this.theme.config.about.echarts && !this.theme.config.about.enable)return
48
+ const lang = hexo.theme.i18n.get(this.config.language || 'zh-CN')
49
+ return {
50
+ path: 'echart/index.html',
51
+ layout: ['page'],
52
+ data: {
53
+ title: lang["page.echarts"],
54
+ type: 'echarts',
55
+ comment: false
56
+ }
57
+ };
58
+ });
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  hexo.extend.filter.register('before_post_render', () => {
4
-
5
4
  const logger = hexo.log;
6
5
  const theme = hexo.theme.config;
7
6
  const config = hexo.config;
@@ -4,6 +4,5 @@ hexo.extend.filter.register('after_render:html', function (data) {
4
4
  if (post.random !== false) posts.push(post.path)
5
5
  })
6
6
  data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ pjax.loadUrl('/'+posts[Math.floor(Math.random()*posts.length)]); };</script>`
7
- //data += `<script>const posts=${JSON.stringify(posts)};function toRandomPost(){ window.pjax ? : window.open('/'+posts[Math.floor(Math.random()*posts.length)], "_self"); };</script>`
8
7
  return data
9
8
  })
@@ -1,36 +1,35 @@
1
1
  hexo.extend.filter.register('after_render:html', function (locals) {
2
- try {
3
- const cheerio = require('cheerio')
4
- const $ = cheerio.load(locals)
5
- const post = $('#posts-chart')
6
- const tag = $('#tags-chart')
7
- const category = $('#categories-chart')
8
- const htmlEncode = false
2
+ const {config, theme} = this
3
+ if (!theme.config.about.echarts.enable) return
9
4
 
10
- if (post.length > 0 || tag.length > 0 || category.length > 0) {
11
- if (post.length > 0 && $('#postsChart').length === 0) {
12
- if (post.attr('data-encode') === 'true') htmlEncode = true
13
- post.after(postsChart(post.attr('data-start')))
14
- }
15
- if (tag.length > 0 && $('#tagsChart').length === 0) {
16
- if (tag.attr('data-encode') === 'true') htmlEncode = true
17
- tag.after(tagsChart(tag.attr('data-length')))
18
- }
19
- if (category.length > 0 && $('#categoriesChart').length === 0) {
20
- if (category.attr('data-encode') === 'true') htmlEncode = true
21
- category.after(categoriesChart(category.attr('data-parent')))
22
- }
5
+ const cheerio = require('cheerio')
6
+ const $ = cheerio.load(locals)
7
+ const post = $('#posts-chart')
8
+ const tag = $('#tags-chart')
9
+ const category = $('#categories-chart')
10
+ const htmlEncode = false
23
11
 
24
- if (htmlEncode) {
25
- return $.root().html().replace(/&amp;#/g, '&#')
26
- } else {
27
- return $.root().html()
28
- }
29
- } else {
30
- return locals
12
+ if (post.length > 0 || tag.length > 0 || category.length > 0) {
13
+ if (post.length > 0 && $('#postsChart').length === 0) {
14
+ if (post.attr('data-encode') === 'true') htmlEncode = true
15
+ post.after(postsChart(post.attr('data-start')))
16
+ }
17
+ if (tag.length > 0 && $('#tagsChart').length === 0) {
18
+ if (tag.attr('data-encode') === 'true') htmlEncode = true
19
+ tag.after(tagsChart(tag.attr('data-length')))
20
+ }
21
+ if (category.length > 0 && $('#categoriesChart').length === 0) {
22
+ if (category.attr('data-encode') === 'true') htmlEncode = true
23
+ category.after(categoriesChart(category.attr('data-parent')))
31
24
  }
32
- } catch (e) {
33
25
 
26
+ if (htmlEncode) {
27
+ return $.root().html().replace(/&amp;#/g, '&#')
28
+ } else {
29
+ return $.root().html()
30
+ }
31
+ } else {
32
+ return locals
34
33
  }
35
34
  }, 15)
36
35
 
@@ -0,0 +1,23 @@
1
+ hexo.extend.filter.register('stylus:renderer', function (style) {
2
+ const {config, theme} = this
3
+
4
+ // 侧边栏标签高亮
5
+ if (theme.config.aside.tags.highlight) {
6
+ let array = theme.config.aside.tags.list.map(item => encodeURIComponent(item));
7
+ style.define('highlightTags', array);
8
+ }
9
+
10
+ // 侧边栏加载样式控制
11
+ let aside = [
12
+ theme.config.aside.home.noSticky,
13
+ theme.config.aside.home.Sticky,
14
+ theme.config.aside.post.noSticky,
15
+ theme.config.aside.post.Sticky,
16
+ theme.config.aside.page.Sticky,
17
+ theme.config.aside.page.noSticky
18
+ ].join(',').split(',');
19
+ let uniqueArr = [...new Set(aside)]; // 去重
20
+ if (uniqueArr.length > 0) { // 是否为空
21
+ style.define('aside', uniqueArr);
22
+ }
23
+ });
@@ -1,42 +1,7 @@
1
1
  'use strict'
2
- let playIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 20 20" fill="none" class="icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.67735 4.2798C5.98983 4.1725 7.85812 4.0625 10 4.0625C12.1421 4.0625 14.0105 4.17252 15.323 4.27983C16.2216 4.3533 16.9184 5.04049 16.9989 5.9318C17.0962 7.00837 17.1875 8.43614 17.1875 10C17.1875 11.5639 17.0962 12.9916 16.9989 14.0682C16.9184 14.9595 16.2216 15.6467 15.323 15.7202C14.0105 15.8275 12.1421 15.9375 10 15.9375C7.85812 15.9375 5.98983 15.8275 4.67735 15.7202C3.77861 15.6467 3.08174 14.9593 3.00119 14.0678C2.90388 12.9908 2.8125 11.5627 2.8125 10C2.8125 8.43727 2.90388 7.00924 3.00119 5.93221C3.08174 5.04067 3.77861 4.35327 4.67735 4.2798ZM10 2.8125C7.81674 2.8125 5.9136 2.92456 4.5755 3.03395C3.07738 3.15643 1.8921 4.31616 1.75626 5.81973C1.65651 6.92379 1.5625 8.39058 1.5625 10C1.5625 11.6094 1.65651 13.0762 1.75626 14.1803C1.8921 15.6838 3.07738 16.8436 4.5755 16.966C5.9136 17.0754 7.81674 17.1875 10 17.1875C12.1835 17.1875 14.0868 17.0754 15.4249 16.966C16.9228 16.8436 18.108 15.6841 18.2438 14.1807C18.3435 13.077 18.4375 11.6105 18.4375 10C18.4375 8.38948 18.3435 6.92296 18.2438 5.81931C18.108 4.31588 16.9228 3.15645 15.4249 3.03398C14.0868 2.92458 12.1835 2.8125 10 2.8125ZM12.1876 10.722C12.7431 10.4013 12.7431 9.59941 12.1876 9.27866L9.06133 7.47373C8.50577 7.15298 7.81133 7.55392 7.81133 8.19542V11.8053C7.81133 12.4468 8.50577 12.8477 9.06133 12.527L12.1876 10.722Z" fill="#9499A0"/></svg>`
3
- let likeIcon = `<svg width="18" height="18" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg" class="icon"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.77234 30.8573V11.7471H7.54573C5.50932 11.7471 3.85742 13.3931 3.85742 15.425V27.1794C3.85742 29.2112 5.50932 30.8573 7.54573 30.8573H9.77234ZM11.9902 30.8573V11.7054C14.9897 10.627 16.6942 7.8853 17.1055 3.33591C17.2666 1.55463 18.9633 0.814421 20.5803 1.59505C22.1847 2.36964 23.243 4.32583 23.243 6.93947C23.243 8.50265 23.0478 10.1054 22.6582 11.7471H29.7324C31.7739 11.7471 33.4289 13.402 33.4289 15.4435C33.4289 15.7416 33.3928 16.0386 33.3215 16.328L30.9883 25.7957C30.2558 28.7683 27.5894 30.8573 24.528 30.8573H11.9911H11.9902Z"></path></svg>`
4
- let coinIcon = `<svg width="18" height="18" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" class="icon" style="fill:;"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.045 25.5454C7.69377 25.5454 2.54504 20.3967 2.54504 14.0454C2.54504 7.69413 7.69377 2.54541 14.045 2.54541C20.3963 2.54541 25.545 7.69413 25.545 14.0454C25.545 17.0954 24.3334 20.0205 22.1768 22.1771C20.0201 24.3338 17.095 25.5454 14.045 25.5454ZM9.66202 6.81624H18.2761C18.825 6.81624 19.27 7.22183 19.27 7.72216C19.27 8.22248 18.825 8.62807 18.2761 8.62807H14.95V10.2903C17.989 10.4444 20.3766 12.9487 20.3855 15.9916V17.1995C20.3854 17.6997 19.9799 18.1052 19.4796 18.1052C18.9793 18.1052 18.5738 17.6997 18.5737 17.1995V15.9916C18.5667 13.9478 16.9882 12.2535 14.95 12.1022V20.5574C14.95 21.0577 14.5444 21.4633 14.0441 21.4633C13.5437 21.4633 13.1382 21.0577 13.1382 20.5574V12.1022C11.1 12.2535 9.52148 13.9478 9.51448 15.9916V17.1995C9.5144 17.6997 9.10883 18.1052 8.60856 18.1052C8.1083 18.1052 7.70273 17.6997 7.70265 17.1995V15.9916C7.71158 12.9487 10.0992 10.4444 13.1382 10.2903V8.62807H9.66202C9.11309 8.62807 8.66809 8.22248 8.66809 7.72216C8.66809 7.22183 9.11309 6.81624 9.66202 6.81624Z"></path></svg>`
5
2
 
6
3
  function bilibili(args) {
7
- const id = args[0].replace(/.*video\/(.*)\/.*/, '$1')
8
- const time = args[1]
9
- return `
10
- <a href="https://www.bilibili.com/video/${id}/" class="bilibili_box" id="${id}" onclick="event.stopPropagation()"></a>
11
-
12
- <script>
13
- bilibili()
14
- function bilibili() {
15
- let dom = document.getElementById('${id}')
16
- fetch('https://api.320.ink/api/b?id=${id}').then(res=>res.json()).then(data=>{
17
- dom.innerHTML = \`
18
- <div class="bilibili_cover">
19
- <img src="https://s1.hdslb.com/bfs/static/player/img/play.svg" class="play_icon nolazyload">
20
- <img src="\${data.pic + '&h=300'}" class="nolazyload">
21
- ${time ? `<span>${time}</span>` : ''}
22
- </div>
23
- <div class="bilibili_info">
24
- <div class="title">\${data.title}</div>
25
- <div class="stat">
26
- <span>${playIcon}\${data.view}</span>
27
- <span>${likeIcon}\${data.like}</span>
28
- <span>${coinIcon}\${data.coin}</span>
29
- </div>
30
- <div class="owner">
31
- <span class="tip">视频</span>
32
- <img src="\${data.face + '&h=100'}" class="nolazyload">
33
- <span>\${data.owner}</span>
34
- </div>
35
- </div>\`
36
- })
37
- }
38
- </script>
39
- `
4
+ return `<iframe class="bvideo" src="${args}"></iframe>`
40
5
  }
41
6
 
42
7
  hexo.extend.tag.register('bilibili', bilibili, { ends: false })