hexo-theme-solitude 1.7.14 → 1.8.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 (41) hide show
  1. package/README.md +25 -25
  2. package/{README_zh-cn.md → README_en.md} +25 -25
  3. package/README_zh-tw.md +3 -3
  4. package/_config.yml +41 -34
  5. package/layout/includes/body/mode.pug +6 -3
  6. package/layout/includes/console.pug +1 -1
  7. package/layout/includes/footer.pug +2 -2
  8. package/layout/includes/head/config.pug +3 -36
  9. package/layout/includes/head/page_config.pug +9 -0
  10. package/layout/includes/head.pug +4 -1
  11. package/layout/includes/inject/body.pug +1 -26
  12. package/layout/includes/inject/head.pug +8 -60
  13. package/layout/includes/rightmenu.pug +2 -2
  14. package/layout/includes/widgets/page/links/banner.pug +1 -1
  15. package/layout/includes/widgets/post/postMeta.pug +18 -17
  16. package/layout/includes/widgets/third-party/comments/artalk.pug +29 -18
  17. package/layout/includes/widgets/third-party/comments/comment.pug +48 -12
  18. package/layout/includes/widgets/third-party/comments/twikoo.pug +72 -55
  19. package/layout/includes/widgets/third-party/comments/valine.pug +43 -49
  20. package/layout/includes/widgets/third-party/comments/waline.pug +44 -52
  21. package/layout/includes/widgets/third-party/news-comment/artalk.pug +57 -67
  22. package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +10 -10
  23. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +41 -48
  24. package/layout/includes/widgets/third-party/news-comment/valine.pug +19 -17
  25. package/layout/includes/widgets/third-party/news-comment/waline.pug +3 -3
  26. package/layout/includes/widgets/third-party/pjax.pug +1 -0
  27. package/package.json +1 -1
  28. package/plugins.yml +2 -2
  29. package/scripts/event/merge_config.js +280 -255
  30. package/scripts/filter/comment.js +13 -0
  31. package/scripts/filter/default.js +1 -1
  32. package/source/css/_comments/comment.styl +73 -12
  33. package/source/css/_comments/valine.styl +1 -1
  34. package/source/css/_highlight/index.styl +1 -0
  35. package/source/css/_tags/link.styl +7 -2
  36. package/source/css/index.styl +1 -1
  37. package/source/js/barrage_comment.js +18 -12
  38. package/source/js/main.js +42 -18
  39. package/source/js/right_menu.js +3 -3
  40. package/source/js/tw_cn.js +3 -3
  41. package/source/js/utils.js +62 -0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [简体中文](README_zh-cn.md)丨[繁体中文](README_zh-tw.md)丨English
1
+ 简体中文丨[繁体中文](README_zh-tw.md)丨[English](README_en.md)
2
2
 
3
3
  <div align="center">
4
4
 
@@ -6,10 +6,10 @@
6
6
 
7
7
  <h1>Hexo Theme Solitude</h1>
8
8
 
9
- An elegant Hexo theme that supports lazy loading, PWA, Latex, and multiple comment systems.
9
+ 一款优雅的 Hexo 主题,支持懒加载、PWALatex以及多种评论系统。
10
+
11
+ 主题由 [@张洪Heo](https://github.com/zhheo) 作者全权授权、设计!
10
12
 
11
- Theme is fully licensed and designed by the author of [@张洪Heo](https://github.com/zhheo)!
12
-
13
13
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?color=blue&logo=npm)
14
14
  ![release](https://img.shields.io/github/package-json/v/valor-x/hexo-theme-solitude/master?color=%231ab1ad&label=release)
15
15
  ![license](https://img.shields.io/github/license/valor-x/hexo-theme-solitude?color=FF5531)
@@ -29,7 +29,7 @@
29
29
  [![pwa](https://img.shields.io/badge/pwa-red?logo=pwa)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps)
30
30
 
31
31
  [![twiter](https://img.shields.io/badge/@efu__oo-gray?logo=x)](https://twitter.com/efu_oo)
32
- [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/efuome)
32
+ [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/solitudePro)
33
33
 
34
34
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains)
35
35
  ![DuoLingo](https://img.shields.io/badge/duolingo-support-black?logo=duolingo&logoColor=white)
@@ -37,42 +37,42 @@
37
37
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
38
38
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
39
39
 
40
- [Preview](https://efu.me/) 丨 [Documentation](https://solitude-docs.efu.me/)
40
+ [预览](https://efu.me/) 丨 [文档](https://solitude-docs.efu.me/)
41
41
 
42
42
  </div>
43
43
 
44
44
  ![Screenshot](.github/screenshot.png)
45
45
 
46
- ## Features
46
+ ## 特性
47
47
 
48
- - PjaxLazyLoadPWA
49
- - Comments(Twikoo、Waline、Valine、Discuss)
50
- - ColorMode
51
- - Lightbox(medium-zoom、fancybox)
52
- - Mathematical formulas(Latex)
53
- - Featured pages: Instant Short Article, My Equipment, Online Tools, Music Gallery, Friend Chain Fish Pond, Photo Album Page, Douban Page
54
- - Article features: AI summary, code highlighting
48
+ - 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA
49
+ - 评论(Twikoo、Waline、Valine、Artalk),支持双评论
50
+ - 显示切换(ColorMode)
51
+ - 灯箱(medium-zoom、fancybox)
52
+ - 数学公式(Latex)
53
+ - 特色页面:即刻短文、我的装备、在线工具、音乐馆、友链鱼塘、相册页、豆瓣页
54
+ - 文章功能:AI 摘要、代码高亮
55
55
 
56
56
  ## Todo
57
57
 
58
- - [x] Support Waline
59
- - [ ] Tags plugin
60
- - [ ] Album reconstruction(Removed, to be refactored)
58
+ - [x] Waline 评论支持
59
+ - [ ] Tags plugin 插件化
60
+ - [ ] 相册页重构(已移除,待重构)
61
61
 
62
- ## Setup
62
+ ## 应用
63
63
 
64
- 1. Use the NPM package
64
+ 1. 使用 NPM 包进行安装
65
65
  ```bash
66
66
  npm i hexo-theme-solitude
67
67
  ```
68
- 2. Apply
68
+ 2. 应用主题
69
69
  ```yaml
70
70
  theme: solitude
71
71
  ```
72
+
73
+ 前往 [文档](https://solitude-docs.efu.me/) 获取更多信息。
72
74
 
73
- Check out the [Documentation](https://solitude-docs.efu.me/) for more information.
74
-
75
- ## Sponsors
75
+ ## 赞助者
76
76
 
77
77
  <p align="center">
78
78
  <a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
@@ -80,6 +80,6 @@ Check out the [Documentation](https://solitude-docs.efu.me/) for more informatio
80
80
  </a>
81
81
  </p>
82
82
 
83
- ## License
83
+ ## 版权
84
84
 
85
- [MIT](./LICENSE) License &copy; 2023-PRESENT [Efu](https://github.com/efuo)
85
+ [MIT](./LICENSE) License &copy; 2023-至今 [Efu](https://github.com/efuo)
@@ -1,4 +1,4 @@
1
- 简体中文丨[繁体中文](README_zh-tw.md)丨[English](README.md)
1
+ [简体中文](README.md)丨[繁体中文](README_zh-tw.md)丨English
2
2
 
3
3
  <div align="center">
4
4
 
@@ -6,10 +6,10 @@
6
6
 
7
7
  <h1>Hexo Theme Solitude</h1>
8
8
 
9
- 一款优雅的 Hexo 主题,支持懒加载、PWALatex以及多种评论系统。
10
-
11
- 主题由 [@张洪Heo](https://github.com/zhheo) 作者全权授权、设计!
9
+ An elegant Hexo theme that supports lazy loading, PWA, Latex, and multiple comment systems.
12
10
 
11
+ Theme is fully licensed and designed by the author of [@张洪Heo](https://github.com/zhheo)!
12
+
13
13
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?color=blue&logo=npm)
14
14
  ![release](https://img.shields.io/github/package-json/v/valor-x/hexo-theme-solitude/master?color=%231ab1ad&label=release)
15
15
  ![license](https://img.shields.io/github/license/valor-x/hexo-theme-solitude?color=FF5531)
@@ -29,7 +29,7 @@
29
29
  [![pwa](https://img.shields.io/badge/pwa-red?logo=pwa)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps)
30
30
 
31
31
  [![twiter](https://img.shields.io/badge/@efu__oo-gray?logo=x)](https://twitter.com/efu_oo)
32
- [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/efuome)
32
+ [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/solitudePro)
33
33
 
34
34
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains)
35
35
  ![DuoLingo](https://img.shields.io/badge/duolingo-support-black?logo=duolingo&logoColor=white)
@@ -37,42 +37,42 @@
37
37
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
38
38
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
39
39
 
40
- [预览](https://efu.me/) 丨 [文档](https://solitude-docs.efu.me/)
40
+ [Preview](https://efu.me/) 丨 [Documentation](https://solitude-docs.efu.me/)
41
41
 
42
42
  </div>
43
43
 
44
44
  ![Screenshot](.github/screenshot.png)
45
45
 
46
- ## 特性
46
+ ## Features
47
47
 
48
- - 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA
49
- - 评论(Twikoo、Waline、Valine、Discuss)
50
- - 显示切换(ColorMode)
51
- - 灯箱(medium-zoom、fancybox)
52
- - 数学公式(Latex)
53
- - 特色页面:即刻短文、我的装备、在线工具、音乐馆、友链鱼塘、相册页、豆瓣页
54
- - 文章功能:AI 摘要、代码高亮
48
+ - PjaxLazyLoadPWA
49
+ - Comments(Twikoo、Waline、Valine、Artalk), Can double comment
50
+ - ColorMode
51
+ - Lightbox(medium-zoom、fancybox)
52
+ - Mathematical formulas(Latex)
53
+ - Featured pages: Instant Short Article, My Equipment, Online Tools, Music Gallery, Friend Chain Fish Pond, Photo Album Page, Douban Page
54
+ - Article features: AI summary, code highlighting
55
55
 
56
56
  ## Todo
57
57
 
58
- - [x] Waline 评论支持
59
- - [ ] Tags plugin 插件化
60
- - [ ] 相册页重构(已移除,待重构)
58
+ - [x] Support Waline
59
+ - [ ] Tags plugin
60
+ - [ ] Album reconstruction(Removed, to be refactored)
61
61
 
62
- ## 应用
62
+ ## Setup
63
63
 
64
- 1. 使用 NPM 包进行安装
64
+ 1. Use the NPM package
65
65
  ```bash
66
66
  npm i hexo-theme-solitude
67
67
  ```
68
- 2. 应用主题
68
+ 2. Apply
69
69
  ```yaml
70
70
  theme: solitude
71
71
  ```
72
-
73
- 前往 [文档](https://solitude-docs.efu.me/) 获取更多信息。
74
72
 
75
- ## 赞助者
73
+ Check out the [Documentation](https://solitude-docs.efu.me/) for more information.
74
+
75
+ ## Sponsors
76
76
 
77
77
  <p align="center">
78
78
  <a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
@@ -80,6 +80,6 @@
80
80
  </a>
81
81
  </p>
82
82
 
83
- ## 版权
83
+ ## License
84
84
 
85
- [MIT](./LICENSE) License &copy; 2023-至今 [Efu](https://github.com/efuo)
85
+ [MIT](./LICENSE) License &copy; 2023-PRESENT [Efu](https://github.com/efuo)
package/README_zh-tw.md CHANGED
@@ -1,4 +1,4 @@
1
- [简体中文](README_zh-cn.md)丨繁体中文丨[English](README.md)
1
+ [简体中文](README.md)丨繁体中文丨[English](README_en.md)
2
2
 
3
3
  <div align="center">
4
4
 
@@ -29,7 +29,7 @@
29
29
  [![pwa](https://img.shields.io/badge/pwa-red?logo=pwa)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps)
30
30
 
31
31
  [![twiter](https://img.shields.io/badge/@efu__oo-gray?logo=x)](https://twitter.com/efu_oo)
32
- [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/efuome)
32
+ [![TG](https://img.shields.io/badge/efuome-gray?logo=Telegram&logoColor=white)](https://t.me/solitudePro)
33
33
 
34
34
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains)
35
35
  ![DuoLingo](https://img.shields.io/badge/duolingo-support-black?logo=duolingo&logoColor=white)
@@ -46,7 +46,7 @@
46
46
  ## 特性
47
47
 
48
48
  - 頁面懶載入(Pjax)、圖片懶載入(LazyLoad)、離線應用(PWA)
49
- - 評論(Twikoo、Waline、Valine、Discuss)
49
+ - 評論(Twikoo、Waline、Valine、Artalk),支援雙評論
50
50
  - 顯示切換(ColorMode)
51
51
  - 燈箱(medium-zoom、fancybox)
52
52
  - 數學公式(Latex)
package/_config.yml CHANGED
@@ -708,43 +708,50 @@ katex:
708
708
 
709
709
  # 评论
710
710
  # comment
711
+ # getting start: http://solitude-docs.efu.me/comments/comment
711
712
  comment:
712
- enable: false
713
- type: # waline, twikoo, valine, artalk
713
+ use: # waline, twikoo, valine, artalk
714
714
  commentBarrage: false # 热评开关 / Hot comment switch
715
- lazyload: true # 懒加载
716
- count: true # 评论数展示
715
+ lazyload: false # 懒加载
716
+ count: false # 评论数展示
717
717
  avatar: https://cravatar.cn # Gravatar link
718
718
  newest_comment:
719
719
  enable: false
720
- storage: .5 # 缓存时间 1: 1天 / .5 : 半天
721
- # twikoo 配置信息
722
- # twikoo settings
723
- twikoo: # https://twikoo.js.org/
724
- envId: # url: https://twikoo.sondy.top/
725
- lang: "zh-CN" # 语言
726
- accessToken: # accessToken
727
- # waline 配置信息
728
- # waline settings
729
- waline: # https://waline.js.org/
730
- envId: # url: https://waline.wzsco.top
731
- pageview: false # 是否开启页面访问量统计 / Whether to enable page access statistics
732
- option: # waline配置项 / waline configuration item
733
- # valine 配置信息
734
- # valine settings
735
- valine:
736
- appId: # leancloud application app id
737
- appKey: # leancloud application app key
738
- serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
739
- avatar:
740
- visitor: false
741
- option: # options list
742
- # artalk 配置信息
743
- # artalk settings
744
- artalk:
745
- server: # server url / 后端地址
746
- site: # site name / 站点名
747
- option: # options
720
+ storage: .5 # 缓存时间 1: 1天 / .5 : 半天 / Cache time 1: 1 day .5 : half a day
721
+
722
+ # twikoo 配置信息
723
+ # twikoo settings
724
+ twikoo: # https://twikoo.js.org/
725
+ envId: # url: https://twikoo.sondy.top/
726
+ region: # 环境地域,默认为 ap-shanghai,腾讯云环境填 ap-shanghai 或 ap-guangzhou;Vercel 环境不填
727
+ style: true # Use custom styles when turned on / 开启后使用自定义样式
728
+ accessToken: # AccessToken
729
+ option: # twikoo option
730
+
731
+ # waline 配置信息
732
+ # waline settings
733
+ waline: # https://waline.js.org/
734
+ envId: # url: https://waline.wzsco.top
735
+ pageview: false # 是否开启页面访问量统计 / Whether to enable page access statistics
736
+ option: # waline配置项 / waline configuration item
737
+
738
+ # valine 配置信息
739
+ # valine settings
740
+ valine:
741
+ appId: # leancloud application app id
742
+ appKey: # leancloud application app key
743
+ serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
744
+ avatar: # https://valine.js.org/avatar.html
745
+ visitor: false
746
+ style: true # Use custom styles when turned on / 开启后使用自定义样式
747
+ option: # options list
748
+
749
+ # artalk 配置信息
750
+ # artalk settings
751
+ artalk:
752
+ server: # server url / 后端地址
753
+ site: # site name / 站点名
754
+ option: # options
748
755
 
749
756
  # 中控台扩展 : 最新评论 + 标签 + 文章
750
757
  console_plus: false
@@ -818,7 +825,7 @@ right_menu:
818
825
  commentBarrage: false # 是否显示热评开关 / Whether to display the hot comment switch.
819
826
  # 翻译功能(仅支持简繁)
820
827
  # Translation function (Simplified and Traditional Chinese only)
821
- translate:
828
+ translate:
822
829
  enable: false
823
830
  defaultEncoding: 2 # 1: 默认繁体 2: 默认简体
824
831
  translateDelay: 0 # 首次加载翻译迟疑时间
@@ -856,7 +863,7 @@ CDN:
856
863
  internal: local
857
864
  # The CDN provider of third party scripts (第三方 js 的 cdn 配置)
858
865
  # option: jsdelivr/unpkg/cdnjs/custom
859
- third_party: custom
866
+ third_party: cdnjs
860
867
 
861
868
  # Add version number to url, true or false
862
869
  version: true
@@ -3,7 +3,7 @@ case theme.display_mode.type
3
3
  script.
4
4
  initTheme = () => {
5
5
  let isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
6
- const cachedMode = saveToLocal.get('theme');
6
+ const cachedMode = utils.saveToLocal.get('theme');
7
7
  if (cachedMode === undefined) {
8
8
  const nowMode =
9
9
  isDarkMode ? 'dark' : 'light'
@@ -11,25 +11,28 @@ case theme.display_mode.type
11
11
  } else {
12
12
  document.documentElement.setAttribute('data-theme', cachedMode);
13
13
  }
14
+ right_menu && rm.mode(cachedMode === 'dark' && isDarkMode)
14
15
  }
15
16
  initTheme()
16
17
  when "dark"
17
18
  script.
18
19
  initTheme = () => {
19
- const cachedMode = saveToLocal.get('theme');
20
+ const cachedMode = utils.saveToLocal.get('theme');
20
21
  if (cachedMode === undefined)
21
22
  document.documentElement.setAttribute('data-theme', 'dark');
22
23
  else
23
24
  document.documentElement.setAttribute('data-theme', cachedMode);
25
+ right_menu && rm.mode(cachedMode === undefined || cachedMode === 'dark')
24
26
  }
25
27
  initTheme()
26
28
  when "light"
27
29
  script.
28
30
  initTheme = () => {
29
- const cachedMode = saveToLocal.get('theme');
31
+ const cachedMode = utils.saveToLocal.get('theme');
30
32
  if (cachedMode === undefined)
31
33
  document.documentElement.setAttribute('data-theme', 'light');
32
34
  else
33
35
  document.documentElement.setAttribute('data-theme', cachedMode);
36
+ right_menu && rm.mode(cachedMode === 'dark')
34
37
  }
35
38
  initTheme()
@@ -39,7 +39,7 @@ div#console
39
39
  div.console-btn-item#consoleMusic(onclick="sco.musicToggle()")
40
40
  span.music-switch(title=_p('console.switch_music'))
41
41
  i.solitude.st-disc-fill
42
- if theme.comment.enable && theme.comment.commentBarrage
42
+ if theme.comment.use && theme.comment.commentBarrage
43
43
  div.console-btn-item.on#consoleCommentBarrage(onclick="sco.switchCommentBarrage()")
44
44
  span.commentBarrage
45
45
  i.solitude.st-chat-fill
@@ -52,7 +52,7 @@ div#footer-bar
52
52
  a.footer-bar-link(href=url_for("/"))= config.author
53
53
  div.footer-bar-right
54
54
  each item in theme.footer.links
55
- a.footer-bar-link(href=url_for(item.url), title=item.name)= item.name
55
+ a.footer-bar-link(href=url_for(item.url), alt=item.name)!= item.name
56
56
  a.footer-bar-link.cc(href=url_for(theme.footer.license), aria-label = 'copyright')
57
57
  i.solitude.st-copyright-line
58
58
  i.solitude.st-creative-commons-by-line
@@ -65,5 +65,5 @@ if theme.footer.privacy
65
65
  span.cookies-tip= __('cookies.tip')
66
66
  a.cookies-link(href=url_for(theme.footer.privacy), title=_p('cookies.privacy'))
67
67
  i.solitude.st-right-btn-fill
68
- if theme.comment.enable && theme.comment.commentBarrage
68
+ if theme.comment.use && theme.comment.commentBarrage
69
69
  div.comment-barrage.needEndHide
@@ -26,44 +26,11 @@
26
26
 
27
27
  let comment = false
28
28
 
29
- if (theme.comment.enable) {
29
+ if (theme.comment.use) {
30
30
  comment = {
31
31
  avatar: theme.comment.avatar,
32
32
  commentBarrage: theme.comment.commentBarrage,
33
33
  }
34
- switch (theme.comment.type) {
35
- case "twikoo":
36
- comment.url = theme.comment.twikoo.envId
37
- comment.accessToken = theme.comment.twikoo.accessToken
38
- comment.owo = {
39
- body: '.OwO-body',
40
- item: '.OwO-items li'
41
- }
42
- break
43
- case "waline":
44
- comment.url = theme.comment.waline.envId
45
- comment.owo = {
46
- body: '.wl-emoji-popup',
47
- item: '.wl-tab-wrapper button'
48
- }
49
- break
50
- case "valine":
51
- comment.url = theme.comment.valine.serverURLs
52
- comment.appId = theme.comment.valine.appId
53
- comment.appKey = theme.comment.valine.appKey
54
- comment.owo = {
55
- body: '.vwrap',
56
- item: '.vemojis i'
57
- }
58
- break
59
- case "artalk":
60
- comment.owo = {
61
- body: '.atk-grp',
62
- item: '.atk-item'
63
- }
64
- default:
65
- break
66
- }
67
34
  }
68
35
 
69
36
  let post_ai = false
@@ -118,7 +85,7 @@
118
85
  }
119
86
  }
120
87
 
121
- if (theme.comment.enable && theme.comment.commentBarrage) {
88
+ if (theme.comment.use && theme.comment.commentBarrage) {
122
89
  lang.barrage = {
123
90
  title: _p('commentBarrage.title'),
124
91
  }
@@ -139,7 +106,7 @@
139
106
  stop: _p('right_menu.music.stop'),
140
107
  }
141
108
  }
142
- if (theme.comment.enable && theme.comment.commentBarrage) {
109
+ if (theme.comment.use && theme.comment.commentBarrage) {
143
110
  rightMenu.barrage = {
144
111
  open: _p('right_menu.barrage.open'),
145
112
  close: _p('right_menu.barrage.close')
@@ -0,0 +1,9 @@
1
+ script#config-diff.
2
+ var PAGE_CONFIG = {
3
+ is_post: !{is_post()},
4
+ is_page: !{!is_post() && !is_home()},
5
+ is_home: !{is_home()},
6
+ page: '!{page.type}',
7
+ toc: !{!!page.toc},
8
+ comment: !{!!page.comment},
9
+ }
@@ -26,4 +26,7 @@ link(rel="stylesheet", href=url_for(theme.cdn.main_css))
26
26
  include ./inject/head.pug
27
27
 
28
28
  // global head
29
- include ./head/config.pug
29
+ include ./head/config.pug
30
+
31
+ // page-config head
32
+ include ./head/page_config
@@ -11,8 +11,6 @@ mixin katex
11
11
  })();
12
12
 
13
13
  div
14
- script(src=url_for(theme.cdn.main))
15
- script(src=url_for(theme.cdn.utils))
16
14
  script(src=url_for(theme.cdn.waterfall))
17
15
  script(src=url_for(theme.cdn.pjax))
18
16
 
@@ -61,24 +59,10 @@ div
61
59
  script.
62
60
  const coverColorConfig = {
63
61
  api: '!{theme.post.covercolor.api}',
64
- time: !{theme.post.covercolor.time},
62
+ time: !{theme.post.covercolor.time}
65
63
  }
66
64
  script(src=url_for(theme.cdn.cover_api))
67
65
 
68
- if theme.comment.enable
69
- case theme.comment.type
70
- when 'twikoo'
71
- script(src=url_for(theme.cdn.twikoo))
72
- when 'waline'
73
- script(src=url_for(theme.cdn.waline_js))
74
- when 'valine'
75
- script(src=url_for(theme.cdn.blueimp_md5))
76
- script(src=url_for(theme.cdn.valine))
77
- when 'artalk'
78
- script(src=url_for(theme.cdn.artalk_js))
79
- if theme.comment.commentBarrage
80
- script(src=url_for(theme.cdn.commentBarrage))
81
-
82
66
  if theme.music.enable
83
67
  script(src=url_for(theme.cdn.music_js))
84
68
 
@@ -110,15 +94,6 @@ div#js-pjax
110
94
  if theme.busuanzi && (theme.aside.siteinfo.uv || theme.aside.siteinfo.pv)
111
95
  script(async src=url_for(theme.cdn.busuanzi_js))
112
96
 
113
- script#config-diff.
114
- var PAGE_CONFIG = {
115
- is_post: !{is_post()},
116
- is_page: !{!is_post() && !is_home()},
117
- is_home: !{is_home()},
118
- page: '!{page.type}',
119
- toc: !{!!page.toc},
120
- comment: !{!!page.comment},
121
- }
122
97
 
123
98
  if theme.footer.randomlink
124
99
  include ../widgets/randomlink.pug
@@ -11,19 +11,14 @@ if theme.capsule.enable || theme.music.enable
11
11
  if (theme.says.home_mini && theme.says.enable) || theme.carousel
12
12
  link(rel="stylesheet", href=url_for(theme.cdn.swiper_css))
13
13
 
14
+ // fancybox ui
14
15
  if theme.lightbox && theme.fancybox
15
16
  link(rel="stylesheet", href=url_for(theme.cdn.fancyapps_css))
16
17
 
18
+ // katex
17
19
  if theme.katex && theme.katex.enable
18
20
  link(rel="stylesheet", href=url_for(theme.cdn.katex))
19
21
 
20
- if theme.comment.enable
21
- case theme.comment.type
22
- when 'waline'
23
- link(rel="stylesheet" href=url_for(theme.cdn.waline_css))
24
- when 'artalk'
25
- link(rel="stylesheet" href=url_for(theme.cdn.artalk_css))
26
-
27
22
  // Open Graph
28
23
  include ../head/opengraph.pug
29
24
 
@@ -32,63 +27,16 @@ if theme.pwa.enable
32
27
  include ../head/pwa.pug
33
28
 
34
29
  script.
35
- (win => {
36
- win.saveToLocal = {
37
- set: function setWithExpiry(key, value, ttl) {
38
- if (ttl === 0)
39
- return
40
- const now = new Date()
41
- const expiryDay = ttl * 86400000
42
- const item = {
43
- value: value,
44
- expiry: now.getTime() + expiryDay
45
- }
46
- localStorage.setItem(key, JSON.stringify(item))
47
- },
48
-
49
- get: function getWithExpiry(key) {
50
- const itemStr = localStorage.getItem(key)
51
-
52
- if (!itemStr) {
53
- return undefined
54
- }
55
- const item = JSON.parse(itemStr)
56
- const now = new Date()
57
-
58
- if (now.getTime() > item.expiry) {
59
- localStorage.removeItem(key)
60
- return undefined
61
- }
62
- return item.value
63
- }
64
- }
65
-
66
- const DarkModeStatus = localStorage.getItem('theme')
67
- if (DarkModeStatus !== null) {
68
- if (DarkModeStatus === 'dark') {
69
- document.documentElement.setAttribute('data-theme', 'dark')
70
- } else {
71
- document.documentElement.setAttribute('data-theme', 'light')
72
- }
73
- }
74
-
75
- const asideStatus = saveToLocal.get('aside-status')
76
- if (asideStatus !== undefined) {
77
- if (asideStatus === 'hide') {
78
- document.documentElement.classList.add('hide-aside')
79
- } else {
80
- document.documentElement.classList.remove('hide-aside')
81
- }
82
- }
83
- }
84
- )(window)
85
-
86
30
  console.log(
87
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.14",
31
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.8.1",
88
32
  "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
89
33
  "padding: 5px 10px;color:white;background:#3e9f50;",
90
34
  "border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
91
35
  );
36
+
92
37
  if theme.extends.head
93
38
  each item in theme.extends.head
94
- != item
39
+ != item
40
+
41
+ script(src=url_for(theme.cdn.utils))
42
+ script(src=url_for(theme.cdn.main))
@@ -17,7 +17,7 @@ div#rightMenu
17
17
  div.rightMenu-item#menu-pastetext
18
18
  i.solitude.st-clipboard-fill
19
19
  span= _p('right_menu.paste')
20
- if theme.comment.enable
20
+ if theme.comment.use
21
21
  div.rightMenu-item#menu-commenttext
22
22
  i.solitude.st-chat-new-fill
23
23
  span= _p('right_menu.comment')
@@ -56,7 +56,7 @@ div#rightMenu
56
56
  i.solitude(class=item.icon)
57
57
  span= item.name
58
58
  div.rightMenu-group.rightMenu-line.rightMenuOther
59
- if theme.right_menu.commentBarrage && theme.comment.enable && theme.comment.commentBarrage
59
+ if theme.right_menu.commentBarrage && theme.comment.use && theme.comment.commentBarrage
60
60
  div.rightMenu-item#menu-commentBarrage(onclick="sco.switchCommentBarrage()")
61
61
  i.solitude.st-chat-fill
62
62
  span.menu-commentBarrage-text= _p('right_menu.barrage.open')
@@ -7,7 +7,7 @@
7
7
  a.banner-button.secondary(onclick="travelling()")
8
8
  i.solitude.st-signal-tower-fill
9
9
  span.banner-button-text=_p('link.banner.random')
10
- if theme.comment.enable
10
+ if theme.comment.use
11
11
  a.banner-button(onclick="sco.scrollToComment()")
12
12
  i.solitude.st-right-btn-fill
13
13
  span.solitude.banner-button-text=_p('link.banner.toComment')