hexo-theme-solitude 1.1.3 → 1.2.1

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 +243 -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} +59 -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 +16 -0
  91. package/layout/includes/widgets/third-party/search/index.pug +7 -0
  92. package/layout/includes/widgets/third-party/search/local-search.pug +15 -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 +944 -0
  120. package/source/css/_page/category.styl +141 -0
  121. package/source/css/_page/equipment.styl +108 -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 +22 -0
  126. package/source/css/_page/link.styl +433 -0
  127. package/source/css/_page/moment.styl +186 -0
  128. package/source/css/_page/rss.styl +87 -0
  129. package/source/css/_page/says.styl +353 -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 +206 -0
  140. package/source/css/_search/local-search.styl +112 -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 +104 -111
  156. package/source/js/extend/search/local-search.js +7 -7
  157. package/source/js/main.js +655 -505
  158. package/source/js/utils.js +131 -137
  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,90 @@
1
+ #aside-content
2
+ .card-power
3
+ .power-charge
4
+ margin-left auto
5
+ color var(--sco-secondtext)
6
+ font-size 14px
7
+ line-height 1
8
+
9
+ &:hover
10
+ color var(--sco-lighttext)
11
+
12
+ #power-star
13
+ display flex
14
+ padding 8px
15
+ border var(--style-border-always)
16
+ border-radius 8px
17
+ flex-direction row
18
+ flex-wrap nowrap
19
+ justify-content flex-start
20
+ position relative
21
+ margin 12px 0
22
+ background var(--sco-secondbg)
23
+ transition .3s ease-out
24
+ cursor pointer
25
+
26
+ &:hover
27
+ background var(--sco-main)
28
+ color var(--sco-white)
29
+ box-shadow var(--sco-shadow-theme)
30
+
31
+ #power-star-image
32
+ transform scale(.9)
33
+
34
+ #power-star-image
35
+ width 60px
36
+ height 60px
37
+ border-radius 60px
38
+ background-size cover
39
+ margin-right 12px
40
+ border var(--style-border-always)
41
+ transition .3s ease-out
42
+
43
+ #power-star-title
44
+ overflow hidden
45
+ text-overflow ellipsis
46
+ white-space nowrap
47
+ font-size 16px
48
+ font-weight 700
49
+ line-height 1
50
+ margin-bottom 8px
51
+
52
+ #power-star-desc
53
+ display -webkit-box
54
+ -webkit-box-orient vertical
55
+ -webkit-line-clamp 2
56
+ overflow hidden
57
+ font-size 12px
58
+ max-width 100%
59
+ line-height 1.2
60
+
61
+ .power-star-body
62
+ display flex
63
+ flex-direction column
64
+ align-items flex-start
65
+ flex-wrap wrap
66
+ position relative
67
+ width calc(100% - 68px)
68
+ justify-content center
69
+
70
+ .power-list
71
+ display flex
72
+ flex-direction row
73
+ flex-wrap wrap
74
+ margin 0 -4px
75
+
76
+ .power-item-body
77
+ display flex
78
+ flex-direction row
79
+ flex-wrap wrap
80
+
81
+ .power-item
82
+ .power-item-link
83
+ a
84
+ padding 2px 4px
85
+ border-radius 4px
86
+ margin-left 8px
87
+
88
+ &:hover
89
+ background var(--sco-main)
90
+ color var(--sco-white)
@@ -0,0 +1,85 @@
1
+ #aside-content
2
+ .card-toc
3
+ padding .5rem .5rem !important
4
+
5
+ &:hover
6
+ box-shadow var(--sco-shadow-border)
7
+
8
+ +minWidth900()
9
+ right 0 !important
10
+
11
+ .toc-content
12
+ overflow-y auto
13
+ max-height calc(100vh - 300px)
14
+
15
+ &::before
16
+ position absolute
17
+ top .6rem
18
+ right 1.2rem
19
+ color #a9a9a9
20
+ content attr(progress-percentage)
21
+ font-style italic
22
+ font-size 1.2rem
23
+
24
+ .toc-link.active
25
+ border-left-color #0061cc
26
+ background #0079ff
27
+ color #fff
28
+
29
+ #card-toc
30
+ +minWidth901()
31
+ right 0 !important
32
+
33
+ .toc-content
34
+ overflow-y: auto
35
+ max-height: calc(100vh - 300px)
36
+ ol
37
+ margin 0
38
+ padding 0
39
+
40
+ &ul
41
+ list-style: none
42
+
43
+ &:hover
44
+ .toc-content
45
+ .toc-link:not(.active) span
46
+ filter: blur(0)
47
+ opacity: 1
48
+
49
+ .toc-item.active .toc-link
50
+ opacity 1
51
+ border-radius 8px
52
+
53
+ .toc-link
54
+ line-height 24px
55
+ padding 8px
56
+ border-left 0 solid transparent
57
+ border-radius 12px
58
+ color var(--sco-secondtext)
59
+ cursor default
60
+ min-height 40px
61
+ display flex
62
+ align-items center
63
+ transition all .2s ease-in-out 0s
64
+
65
+ &.active
66
+ border-radius 12px
67
+ border-left-color var(--sco-hovertext)
68
+ background-color var(--sco-card-bg)
69
+ color var(--sco-lighttext)
70
+ font-weight 700
71
+ font-size 20px
72
+
73
+ &:not(.active) span
74
+ opacity .6
75
+ cursor pointer
76
+ filter blur(1px)
77
+ transition .3s
78
+
79
+ &:hover
80
+ color var(--sco-lighttext)
81
+
82
+ [data-theme=dark]
83
+ .toc
84
+ .toc-item.active .toc-link .toc-text
85
+ color: var(--sco-white)
@@ -0,0 +1,14 @@
1
+ #aside-content
2
+ #welcome-info
3
+ overflow hidden
4
+ margin-top 4px
5
+
6
+ .welcome-time
7
+ width 100%
8
+ margin 12px 0 0
9
+ display inline-flex
10
+
11
+ .welcome-message
12
+ width 100%
13
+ margin-bottom 8px
14
+ display inline-flex
@@ -0,0 +1,3 @@
1
+ // aside(侧边栏)
2
+
3
+ @import "aside/index.styl"
@@ -0,0 +1,40 @@
1
+ @charset "UTF-8"
2
+
3
+ if hexo-config('css_prefix')
4
+ @import 'nib'
5
+
6
+ // project
7
+ @import '_global/animation.css'
8
+ @import '_global/*'
9
+ @import '_layout/*'
10
+ @import '_page/index.styl'
11
+ @import '_post/*'
12
+
13
+ // widgets
14
+ @import '_widgets/index.styl'
15
+
16
+ // comment
17
+ if hexo-config('comment.enable')
18
+ @import '_comment/index.styl'
19
+ @import '_comment/twikoo.styl' when hexo-config('comment.type') == 'twikoo'
20
+
21
+ // commentBarrage
22
+ if hexo-config('thirdparty.comment.enable')
23
+ @import '_post/commentBarrage.styl'
24
+
25
+ // extra
26
+ @import '_extra/console.styl'
27
+
28
+ // rightmenu
29
+ if hexo-config('rightside.enable')
30
+ @import '_extra/rightmenu.styl'
31
+
32
+ // search
33
+ if hexo-config('thirdparty.search.enable')
34
+ if hexo-config('thirdparty.search.type') == 'algolia'
35
+ @import '_search/algolia-search'
36
+ else if hexo-config('thirdparty.search.type') == 'local'
37
+ @import '_search/local-search'
38
+
39
+ // dark
40
+ @import '_mode/*'
@@ -3,12 +3,13 @@ function initializeCommentBarrage() {
3
3
  let e = {
4
4
  maxBarrage: 1,
5
5
  barrageTime: 8e3,
6
- twikooUrl: GLOBALCONFIG.comment.twikooUrl,
6
+ twikooUrl: GLOBAL_CONFIG.comment.twikoo.url,
7
7
  pageUrl: window.location.pathname,
8
- accessToken: GLOBALCONFIG.comment.twikooAccessToken,
8
+ accessToken: GLOBAL_CONFIG.comment.twikoo.accessToken,
9
9
  };
10
10
  new class {
11
11
  commentInterval = null
12
+
12
13
  constructor(e) {
13
14
  this.config = {
14
15
  ...e,
@@ -106,11 +107,11 @@ function initializeCommentBarrage() {
106
107
  async initCommentBarrage() {
107
108
  if (localStorage.getItem("commentBarrageSwitch") != null) {
108
109
  document.querySelector(".comment-barrage").style.display = "flex";
109
- document.querySelector(".menu-commentBarrage-text").textContent = "关闭热评";
110
+ GLOBAL_CONFIG.rightside.enable && (document.querySelector(".menu-commentBarrage-text").textContent = "关闭热评");
110
111
  document.querySelector("#consoleCommentBarrage").classList.add("on");
111
112
  } else {
112
113
  document.querySelector(".comment-barrage").style.display = "none";
113
- document.querySelector(".menu-commentBarrage-text").textContent = "显示热评";
114
+ GLOBAL_CONFIG.rightside.enable && (document.querySelector(".menu-commentBarrage-text").textContent = "显示热评");
114
115
  document.querySelector("#consoleCommentBarrage").classList.remove("on");
115
116
  }
116
117
  const comments = await this.fetchComments();
@@ -154,4 +155,6 @@ function initializeCommentBarrage() {
154
155
  (e)
155
156
  }
156
157
 
157
- initializeCommentBarrage();
158
+ if(PAGE_CONFIG.comment){
159
+ initializeCommentBarrage();
160
+ }
@@ -1,77 +1,76 @@
1
1
  const changeContent = (content) => {
2
2
  if (content === '') return content
3
-
3
+
4
4
  content = content.replace(/<img.*?src="(.*?)"?[^\>]+>|<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>|<pre><code>.*?<\/pre>|<[^>]+>/g, (match, img, link, code) => {
5
- if (img) return '[图片]';
6
- if (link) return '[链接]';
7
- if (code) return '[代码]';
8
- return '';
5
+ if (img) return '[图片]';
6
+ if (link) return '[链接]';
7
+ if (code) return '[代码]';
8
+ return '';
9
9
  })
10
-
10
+
11
11
  if (content.length > 150) {
12
- content = content.substring(0,150) + '...'
12
+ content = content.substring(0, 150) + '...'
13
13
  }
14
14
  return content
15
- }
16
-
17
- const getComment = () => {
15
+ }
16
+
17
+ const getComment = () => {
18
18
  const $dom = document.querySelector('#card-newest-comments .aside-list')
19
-
19
+
20
20
  const runTwikoo = () => {
21
- twikoo.getRecentComments({
22
- envId: GLOBALCONFIG.comment.twikooUrl,
23
- region: '',
24
- pageSize: 6,
25
- includeReply: true
26
- }).then(function (res) {
27
- const twikooArray = res.map(e => ({
28
- 'content': changeContent(e.comment),
29
- 'avatar': e.avatar,
30
- 'nick': e.nick,
31
- 'url': `${e.url}#${e.id}`,
32
- 'date': new Date(e.created).toISOString()
33
- }))
21
+ twikoo.getRecentComments({
22
+ envId: GLOBAL_CONFIG.comment.twikoo.url,
23
+ region: '',
24
+ pageSize: 6,
25
+ includeReply: true
26
+ }).then(function (res) {
27
+ const twikooArray = res.map(e => ({
28
+ 'content': changeContent(e.comment),
29
+ 'avatar': e.avatar,
30
+ 'nick': e.nick,
31
+ 'url': `${e.url}#${e.id}`,
32
+ 'date': new Date(e.created).toISOString()
33
+ }))
34
34
 
35
- if(window.location.pathname === "/links/" || window.location.pathname === "/links"){
36
- let submit = document.getElementsByClassName('tk-submit ')
37
- let text = document.getElementsByClassName("el-textarea__inner");
38
- text[0].value += `昵称(请勿包含博客等字样):
35
+ if (window.location.pathname === "/links/" || window.location.pathname === "/links") {
36
+ let submit = document.getElementsByClassName('tk-submit ')
37
+ let text = document.getElementsByClassName("el-textarea__inner");
38
+ text[0].value += `昵称(请勿包含博客等字样):
39
39
  网站地址(要求博客地址,请勿提交个人主页):
40
40
  头像图片url(请提供尽可能清晰的图片,我会上传到我的图床):
41
41
  描述:`;
42
- text[0].style.height = "142px"
43
- submit.item(0).style.display = "none";
42
+ text[0].style.height = "142px"
43
+ submit.item(0).style.display = "none";
44
44
 
45
- window.checkForm = function(){
46
- const checkboxes = document.querySelectorAll('input[onclick="checkForm()"]');
47
- let allChecked = true;
45
+ window.checkForm = function () {
46
+ const checkboxes = document.querySelectorAll('input[onclick="checkForm()"]');
47
+ let allChecked = true;
48
48
 
49
- checkboxes.forEach(checkbox => {
50
- if (!checkbox.checked) {
51
- allChecked = false;
52
- }
53
- });
49
+ checkboxes.forEach(checkbox => {
50
+ if (!checkbox.checked) {
51
+ allChecked = false;
52
+ }
53
+ });
54
54
 
55
- if(allChecked){
56
- submit.item(0).style.display = "block";
57
- }else {
58
- submit.item(0).style.display = "none";
55
+ if (allChecked) {
56
+ submit.item(0).style.display = "block";
57
+ } else {
58
+ submit.item(0).style.display = "none";
59
+ }
60
+ }
59
61
  }
60
- }
61
- }
62
-
63
- generateHtml(twikooArray)
64
- }).catch(function (err) {
65
- $dom.innerHTML= "无法获取评论,请确认相关配置是否正确"
66
- })
62
+
63
+ generateHtml(twikooArray)
64
+ }).catch(function (err) {
65
+ $dom.innerHTML = "无法获取评论,请确认相关配置是否正确"
66
+ })
67
67
  }
68
- runTwikoo()
69
- }
70
-
71
- const generateHtml = array => {
68
+ runTwikoo()
69
+ }
70
+
71
+ const generateHtml = array => {
72
72
  const $dom = document.querySelector('#card-newest-comments .aside-list')
73
-
74
- let result = array.length ? array.map(item => `
73
+ $dom.innerHTML = array.length ? array.map(item => `
75
74
  <div class='aside-list-item'>
76
75
  <a href='${item.url}' class='thumbnail'>
77
76
  <img src='${item.avatar}' alt='${item.nick}'>
@@ -83,17 +82,15 @@ const changeContent = (content) => {
83
82
  </div>
84
83
  </div>
85
84
  `).join('') : '没有评论'
86
-
87
- $dom.innerHTML = result
88
85
  window.lazyLoadInstance && window.lazyLoadInstance.update()
89
86
  window.pjax && window.pjax.refresh($dom)
90
- chageTimeFormate()
91
- }
92
-
93
- const newestCommentInit = () => {
87
+ changeTimeFormat()
88
+ }
89
+
90
+ const newestCommentInit = () => {
94
91
  const $asideList = document.querySelector('#card-newest-comments .aside-list')
95
92
  if ($asideList) {
96
- getComment()
93
+ getComment()
97
94
  }
98
- }
95
+ }
99
96
 
@@ -144,7 +144,7 @@ function initThemeColor() {
144
144
  let themeColor;
145
145
  if (currentTop > 0) {
146
146
  themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-card-bg');
147
- } else if (PAGECONFIG.is_post) {
147
+ } else if (PAGE_CONFIG.is_post) {
148
148
  themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-main');
149
149
  } else {
150
150
  themeColor = getComputedStyle(document.documentElement).getPropertyValue('--sco-background');