hexo-theme-solitude 2.1.4 → 2.1.6

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 (37) hide show
  1. package/README.md +25 -39
  2. package/{README_zh-Hans.md → README_en-US.md} +25 -39
  3. package/README_zh-Hant.md +4 -18
  4. package/_config.yml +30 -28
  5. package/languages/default.yml +1 -0
  6. package/languages/en.yml +1 -0
  7. package/languages/zh-CN.yml +1 -0
  8. package/languages/zh-TW.yml +1 -0
  9. package/layout/includes/head/config.pug +2 -1
  10. package/layout/includes/head/page_config.pug +3 -1
  11. package/layout/includes/keyboard.pug +2 -1
  12. package/layout/includes/loading.pug +1 -1
  13. package/layout/includes/widgets/aside/aside.pug +1 -1
  14. package/layout/includes/widgets/aside/asideInfoCard.pug +2 -2
  15. package/layout/includes/widgets/page/links/banner.pug +15 -12
  16. package/layout/includes/widgets/rightside/show.pug +1 -1
  17. package/layout/includes/widgets/third-party/music.pug +1 -1
  18. package/layout/includes/widgets/third-party/search/algolia-search.pug +3 -0
  19. package/layout/post.pug +2 -1
  20. package/package.json +1 -1
  21. package/plugins.yml +2 -2
  22. package/scripts/event/cdn.js +1 -1
  23. package/scripts/event/page.js +3 -3
  24. package/scripts/filter/default.js +3 -1
  25. package/scripts/tags/article.js +1 -1
  26. package/scripts/tags/typeit.js +2 -3
  27. package/source/css/_highlight/index.styl +9 -0
  28. package/source/css/_layout/article-container.styl +1 -1
  29. package/source/css/_page/_home/category-bar.styl +1 -0
  30. package/source/css/_page/_home/home.styl +4 -0
  31. package/source/css/_post/pagination.styl +1 -1
  32. package/source/css/_search/algolia-search.styl +23 -16
  33. package/source/css/_search/local-search.styl +11 -11
  34. package/source/css/_tags/gallery.styl +0 -1
  35. package/source/js/main.js +8 -2
  36. package/source/js/search/algolia.js +16 -15
  37. package/source/js/search/local.js +11 -14
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- English丨[简体中文](README_zh-Hans.md)[繁体中文](README_zh-Hant.md)
1
+ [English](README_en-US.md)丨简体中文丨[繁体中文](README_zh-Hant.md)
2
2
 
3
3
  <div align="center">
4
4
 
5
- <h1>Solitude</h1>
5
+ <h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
6
6
 
7
- An elegant Hexo theme that supports lazy loading, PWA, Latex, and multiple commenting systems.
7
+ 一款优雅的 Hexo 主题,支持懒加载、PWALatex 以及多种评论系统。
8
8
 
9
- Theme design is fully licensed by [@张洪Heo](https://github.com/zhheo).
9
+ 主题设计由 [@张洪Heo](https://github.com/zhheo) 全权授权
10
10
 
11
11
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?style=for-the-badge)
12
12
  ![license](https://img.shields.io/github/license/everfu/hexo-theme-solitude?color=FF5531&style=for-the-badge)
@@ -16,11 +16,11 @@ English丨[简体中文](README_zh-Hans.md)丨[繁体中文](README_zh-Hant.md)
16
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white&style=for-the-badge)
17
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white&style=for-the-badge)
18
18
 
19
- ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&base=12345&style=for-the-badge)
19
+ ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&style=for-the-badge)
20
20
  [![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
21
21
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)
22
22
 
23
- [Docs](https://solitude.js.org/)丨[Preview](https://blog.everfu.cn/)
23
+ [文档](https://solitude.js.org/)丨[预览](https://blog.everfu.cn/)
24
24
 
25
25
  </div>
26
26
 
@@ -30,57 +30,43 @@ English丨[简体中文](README_zh-Hans.md)丨[繁体中文](README_zh-Hant.md)
30
30
 
31
31
  </div>
32
32
 
33
- ## Features
33
+ ## 特性
34
34
 
35
- - Page lazy loading (Pjax), image lazy loading (LazyLoad), offline application (PWA)
36
- - Comments (Twikoo, Waline, Valine, Artalk, Giscus), supporting dual comments
37
- - Day and night mode switch (ColorMode)
38
- - Lightbox (medium-zoom, fancybox)
39
- - Mathematical formulas (Latex)
40
- - Special pages: Moments, My Equipment, Online Tools, Music Library, Friends' Links, Photo Album, Douban Page, Danmaku Message Board
41
- - Article features: AI Summary, Code Highlighting
35
+ - 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA
36
+ - 评论(TwikooWalineValineArtalkGiscus),支持双评论
37
+ - 昼夜切换(ColorMode)
38
+ - 灯箱(medium-zoomfancybox)
39
+ - 数学公式(Latex)
40
+ - 特色页面:即刻短文、我的装备、在线工具、音乐馆、友链鱼塘、相册页、豆瓣页、弹幕留言页
41
+ - 文章功能:AI 摘要、代码高亮
42
42
 
43
43
  ## Todo
44
44
 
45
- - [X] Mobile directory support.
46
- - [X] Add a bottom right sidebar.
45
+ - [x] 移动端目录支持
46
+ - [x] 增加右下角侧边栏
47
47
 
48
- > If you have any questions, please issue an [issue](https://github.com/everfu/hexo-theme-solitude/issues)
48
+ > 如有问题请提 [issue](https://github.com/everfu/hexo-theme-solitude/issues)
49
49
 
50
- ## Setup
50
+ ## 应用
51
51
 
52
- 1. Use the NPM package
52
+ 1. 使用 NPM 包进行安装
53
53
  ```bash
54
54
  npm i hexo-theme-solitude
55
55
  ```
56
- 2. Apply
56
+ 2. 应用主题
57
57
  ```yaml
58
58
  theme: solitude
59
59
  ```
60
60
 
61
- Check out the [Documentation](https://solitude.js.org/) for more information.
61
+ 前往 [文档](https://solitude.js.org/) 获取更多信息。
62
62
 
63
- ## Sponsors
64
-
65
- <div align="center">
66
-
67
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W1YSMOK)
68
-
69
- </div>
70
-
71
- <p align="center">
72
- <a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
73
- <img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg' alt="sponsor"/>
74
- </a>
75
- </p>
76
-
77
- ## Community
63
+ ## 社区
78
64
 
79
65
  [![Discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
80
- [![QQ Group](https://img.shields.io/badge/QQ%20Group-948375336-FFD700?logo=Tencent-QQ&logoColor=white&style=for-the-badge)](https://qm.qq.com/q/mxfomMvJPG)
66
+ [![QQ ](https://img.shields.io/badge/QQ%20群-948375336-FFD700?logo=Tencent-QQ&logoColor=white&style=for-the-badge)](https://qm.qq.com/q/mxfomMvJPG)
81
67
 
82
- ## License
68
+ ## 版权
83
69
 
84
- [MIT](./LICENSE) License &copy; 2023-PRESENT [一小只托尼](https://github.com/everfu)
70
+ [MIT](./LICENSE) License &copy; 2023-至今 [伍十七](https://github.com/everfu)
85
71
 
86
72
  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
@@ -1,12 +1,12 @@
1
- [English](README.md)丨简体中文丨[繁体中文](README_zh-Hant.md)
1
+ English丨[简体中文](README.md)[繁体中文](README_zh-Hant.md)
2
2
 
3
3
  <div align="center">
4
4
 
5
- <h1>Solitude</h1>
5
+ <h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
6
6
 
7
- 一款优雅的 Hexo 主题,支持懒加载、PWALatex 以及多种评论系统。
7
+ An elegant Hexo theme that supports lazy loading, PWA, Latex, and multiple commenting systems.
8
8
 
9
- 主题设计由 [@张洪Heo](https://github.com/zhheo) 全权授权
9
+ Theme design is fully licensed by [@张洪Heo](https://github.com/zhheo).
10
10
 
11
11
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?style=for-the-badge)
12
12
  ![license](https://img.shields.io/github/license/everfu/hexo-theme-solitude?color=FF5531&style=for-the-badge)
@@ -16,11 +16,11 @@
16
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white&style=for-the-badge)
17
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white&style=for-the-badge)
18
18
 
19
- ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&base=12345&style=for-the-badge)
19
+ ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&style=for-the-badge)
20
20
  [![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
21
21
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)
22
22
 
23
- [文档](https://solitude.js.org/)丨[预览](https://blog.everfu.cn/)
23
+ [Docs](https://solitude.js.org/)丨[Preview](https://blog.everfu.cn/)
24
24
 
25
25
  </div>
26
26
 
@@ -30,57 +30,43 @@
30
30
 
31
31
  </div>
32
32
 
33
- ## 特性
33
+ ## Features
34
34
 
35
- - 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA
36
- - 评论(TwikooWalineValineArtalkGiscus),支持双评论
37
- - 昼夜切换(ColorMode)
38
- - 灯箱(medium-zoomfancybox)
39
- - 数学公式(Latex)
40
- - 特色页面:即刻短文、我的装备、在线工具、音乐馆、友链鱼塘、相册页、豆瓣页、弹幕留言页
41
- - 文章功能:AI 摘要、代码高亮
35
+ - Page lazy loading (Pjax), image lazy loading (LazyLoad), offline application (PWA)
36
+ - Comments (Twikoo, Waline, Valine, Artalk, Giscus), supporting dual comments
37
+ - Day and night mode switch (ColorMode)
38
+ - Lightbox (medium-zoom, fancybox)
39
+ - Mathematical formulas (Latex)
40
+ - Special pages: Moments, My Equipment, Online Tools, Music Library, Friends' Links, Photo Album, Douban Page, Danmaku Message Board
41
+ - Article features: AI Summary, Code Highlighting
42
42
 
43
43
  ## Todo
44
44
 
45
- - [x] 移动端目录支持
46
- - [x] 增加右下角侧边栏
45
+ - [X] Mobile directory support.
46
+ - [X] Add a bottom right sidebar.
47
47
 
48
- > 如有问题请提 [issue](https://github.com/everfu/hexo-theme-solitude/issues)
48
+ > If you have any questions, please issue an [issue](https://github.com/everfu/hexo-theme-solitude/issues)
49
49
 
50
- ## 应用
50
+ ## Setup
51
51
 
52
- 1. 使用 NPM 包进行安装
52
+ 1. Use the NPM package
53
53
  ```bash
54
54
  npm i hexo-theme-solitude
55
55
  ```
56
- 2. 应用主题
56
+ 2. Apply
57
57
  ```yaml
58
58
  theme: solitude
59
59
  ```
60
60
 
61
- 前往 [文档](https://solitude.js.org/) 获取更多信息。
61
+ Check out the [Documentation](https://solitude.js.org/) for more information.
62
62
 
63
- ## 赞助者
64
-
65
- <div align="center">
66
-
67
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W1YSMOK)
68
-
69
- </div>
70
-
71
- <p align="center">
72
- <a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
73
- <img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg' alt="赞助者"/>
74
- </a>
75
- </p>
76
-
77
- ## 社区
63
+ ## Community
78
64
 
79
65
  [![Discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
80
- [![QQ ](https://img.shields.io/badge/QQ%20群-948375336-FFD700?logo=Tencent-QQ&logoColor=white&style=for-the-badge)](https://qm.qq.com/q/mxfomMvJPG)
66
+ [![QQ Group](https://img.shields.io/badge/QQ%20Group-948375336-FFD700?logo=Tencent-QQ&logoColor=white&style=for-the-badge)](https://qm.qq.com/q/mxfomMvJPG)
81
67
 
82
- ## 版权
68
+ ## License
83
69
 
84
- [MIT](./LICENSE) License &copy; 2023-至今 [一小只托尼](https://github.com/efuo)
70
+ [MIT](./LICENSE) License &copy; 2023-PRESENT [伍十七](https://github.com/everfu)
85
71
 
86
72
  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
package/README_zh-Hant.md CHANGED
@@ -1,8 +1,8 @@
1
- [English](README.md)丨[简体中文](README_zh-Hans.md)丨繁体中文
1
+ [English](README_en-US.md)丨[简体中文](README.md)丨繁体中文
2
2
 
3
3
  <div align="center">
4
4
 
5
- <h1>Solitude</h1>
5
+ <h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
6
6
 
7
7
  一款優雅的 Hexo 主題,支援懶載入、PWA、Latex 以及多種評論系統。
8
8
 
@@ -16,7 +16,7 @@
16
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white&style=for-the-badge)
17
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white&style=for-the-badge)
18
18
 
19
- ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&base=12345&style=for-the-badge)
19
+ ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&abbreviated=true&style=for-the-badge)
20
20
  [![discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
21
21
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-black?logo=jetbrains&style=for-the-badge)
22
22
 
@@ -58,20 +58,6 @@
58
58
 
59
59
  前往 [文檔](https://solitude.js.org/) 獲取更多資訊。
60
60
 
61
- ## 贊助者
62
-
63
- <div align="center">
64
-
65
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W1YSMOK)
66
-
67
- </div>
68
-
69
- <p align="center">
70
- <a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
71
- <img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg'/>
72
- </a>
73
- </p>
74
-
75
61
  ## 社區
76
62
 
77
63
  [![Discord](https://img.shields.io/discord/1266610921942548553?style=for-the-badge&logo=discord&label=discord&logoColor=white)](https://discord.gg/HZXAnK4Sut)
@@ -79,6 +65,6 @@
79
65
 
80
66
  ## 版權
81
67
 
82
- [MIT](./LICENSE) License &copy; 2023-至今 [一小只托尼](https://github.com/everfu)
68
+ [MIT](./LICENSE) License &copy; 2023-至今 [伍十七](https://github.com/everfu)
83
69
 
84
70
  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
package/_config.yml CHANGED
@@ -37,30 +37,29 @@ nav:
37
37
  # Menu
38
38
  # 菜单
39
39
  menu:
40
- # Home: / # name: link
41
- # Article: # name
42
- # Archives: /archives/ || fas fa-folder-closed # item name: link || icon
43
- # Categories: /categories/ || fas fa-clone
44
- # Tags: /tags/ || fas fa-tags
45
- # Friends:
46
- # Moments: /moments/ || fas fa-wifi
47
- # Links: /links/ || fas fa-user-group
48
- # Treasure: javascript:travelling() || fas fa-gift
49
- # Myself:
50
- # Equipment: /equipment/ || fas fa-laptop
51
- # Toobox: /tlink/ || fas fa-toolbox
52
- # Music: /music/ || fas fa-music
53
- # About: /about/
40
+ # 首页: / # name: link
41
+ # 文库: # name
42
+ # 全部文章: /archives/ || fas fa-folder-closed # item name: link || icon
43
+ # 全部分类: /categories/ || fas fa-clone
44
+ # 全部标签: /tags/ || fas fa-tags
45
+ # 友链:
46
+ # 朋友圈: /moments/ || fas fa-wifi
47
+ # 友情链接: /links/ || fas fa-user-group
48
+ # 宝藏博主: javascript:travelling() || fas fa-gift
49
+ # 关于:
50
+ # 我的装备: /equipment/ || fas fa-laptop
51
+ # 在线工具: /tlink/ || fas fa-toolbox
52
+ # 音乐馆: /music/ || fas fa-music
54
53
 
55
54
  # Right button
56
55
  # 右侧按钮
57
56
  right:
58
57
  random: false # Random article / 随机文章按钮
59
58
  custom:
60
- # - name: Start # name
61
- # url: https://www.travellings.cn/go.html # Jump link
62
- # icon: fas fa-train # Icon
63
- # onclick: # Click event
59
+ # - name: 开往 # 名字
60
+ # url: https://www.travellings.cn/go.html # 跳转链接
61
+ # icon: fas fa-train # 图标
62
+ # onclick: # 点击事件
64
63
  # id: travellings_button # id
65
64
  # --------------------------- end ---------------------------
66
65
 
@@ -70,8 +69,8 @@ nav:
70
69
  hometop:
71
70
  enable: false
72
71
  banner:
73
- title: # Tranquility <br>and love life / 宁静致远 <br> 热爱生活 # Title
74
- url: Hexo Theme Solitude
72
+ title: # 宁静致远 <br> 热爱生活 # 标题
73
+ url: Hexo Theme Solitude # 小字
75
74
  icon:
76
75
  # HTML: # name
77
76
  # img: https://i.postimg.cc/vBWVnY8q/html.png # url
@@ -143,17 +142,17 @@ aside:
143
142
  # Style 2 is invalid
144
143
  # Style 2 无效
145
144
  sayhello:
146
- morning: ✨ Good morning. It's a new day
147
- noon: It's time for a midday break
148
- afternoon: Tea time. 🍵
149
- night: early bedtime
150
- goodnight: Good night 😴
145
+ morning: ✨ 早上好,新的一天开始了
146
+ noon: 🍲 午餐时间
147
+ afternoon: 🌞 下午好
148
+ night: 早点休息
149
+ goodnight: 晚安 😴
151
150
  # Style 2 is invalid, Triggered when sayhello is clicked.
152
151
  # Style 2 无效, 点击 sayhello 时触发
153
152
  sayhello2:
154
- # - You'll make it.
155
- # - You're gonna make it.
156
- # - Good luck, stranger.
153
+ # - 你可以的
154
+ # - 你一定可以的
155
+ # - 祝你好运,陌生人
157
156
  # social
158
157
  # 社交信息图标
159
158
  information:
@@ -658,6 +657,9 @@ loading:
658
657
  # Full screen loading
659
658
  # 全屏加载
660
659
  fullpage: false
660
+ # Loading icon, default is siteicon
661
+ # 加载图标,不写默认siteicon
662
+ favicon: /img/favicon.png
661
663
  # Pace loading
662
664
  # Pace 加载
663
665
  pace: true
@@ -96,6 +96,7 @@ search:
96
96
  hit: Found ${query} results for you
97
97
  placeholder: Enter keywords to search
98
98
  count: Total <b>${count}</b> results.
99
+ load: Loading...
99
100
 
100
101
  head:
101
102
  noscript: Please enable JavaScript to view the site
package/languages/en.yml CHANGED
@@ -96,6 +96,7 @@ search:
96
96
  hit: Found ${query} results for you
97
97
  placeholder: Enter keywords to search
98
98
  count: Total <b>${count}</b> results.
99
+ load: Loading...
99
100
 
100
101
  head:
101
102
  noscript: Please enable JavaScript to view the site
@@ -96,6 +96,7 @@ search:
96
96
  hit: 找到 ${hits} 条结果,用时 ${time} 毫秒
97
97
  placeholder: 输入关键词快速查找
98
98
  count: 共 <b>${count}</b> 条结果。
99
+ load: 搜索中...
99
100
 
100
101
  head:
101
102
  noscript: 开启JavaScript才能访问本站哦~
@@ -96,6 +96,7 @@ search:
96
96
  hit: 找到 ${hits} 條結果,用時 ${time} 毫秒
97
97
  placeholder: 輸入關鍵詞快速查找
98
98
  count: 共 <b>${count}<b> 條結果。
99
+ load: 加載中...
99
100
 
100
101
  head:
101
102
  noscript: 開啟JavaScript才能訪問本站哦~
@@ -83,7 +83,8 @@
83
83
  empty: _p('search.empty'),
84
84
  hit: _p('search.hit'),
85
85
  placeholder: _p('search.placeholder'),
86
- count: _p('search.count')
86
+ count: _p('search.count'),
87
+ loading: _p('search.load'),
87
88
  }
88
89
  }
89
90
 
@@ -1,10 +1,12 @@
1
+ - var showToc = !!page.toc && (toc(page.content) !== '' || page.encrypt === true);
2
+
1
3
  script#config-diff.
2
4
  var PAGE_CONFIG = {
3
5
  is_post: !{is_post()},
4
6
  is_page: !{!is_post() && !is_home()},
5
7
  is_home: !{is_home()},
6
8
  page: '!{page.type}',
7
- toc: !{!!page.toc},
9
+ toc: !{showToc},
8
10
  comment: !{!!page.comment},
9
11
  ai_text: !{is_post && page.ai_text ? "'"+ page.ai_text+"'" : false},
10
12
  color: !{page.color ? "'"+ page.color+"'" : false},
@@ -61,5 +61,6 @@ script.
61
61
  var sco_keyboards = localStorage.getItem('keyboard') === 'true'
62
62
  if (sco_keyboards) {
63
63
  openKeyboard();
64
- document.getElementById('consoleKeyboard').classList.add('on');
64
+ let keyboard = document.getElementById('consoleKeyboard');
65
+ keyboard?.classList.add('on');
65
66
  }
@@ -1,6 +1,6 @@
1
1
  div(id="loading-box" onclick="preloader.endLoading();" style="zoom:1")
2
2
  div.loading-bg
3
- img.loading-img.nolazyload(src=url_for(theme.site.icon), alt="loading image")
3
+ img.loading-img.nolazyload(src=url_for(theme.loading.favicon || theme.site.icon), alt="loading image")
4
4
 
5
5
  script.
6
6
  const preloader = {
@@ -12,7 +12,7 @@
12
12
  each item in noSticky
13
13
  include ./asideSwitch.pug
14
14
  .sticky_layout
15
- if page.toc
15
+ if showToc
16
16
  include ./asideToc.pug
17
17
  each item in Sticky
18
18
  include ./asideSwitch.pug
@@ -43,11 +43,11 @@
43
43
  a(href=url_for('/archives/') title=_p('aside.card.posts') + site.posts.length)
44
44
  .length-num= site.posts.length
45
45
  .headline= _p('page.archives')
46
- if site.tags.length !== 0 && theme.page.tags
46
+ if site.tags.length !== 0 || theme.page.tags
47
47
  a(href=url_for('/tags/') title=_p('aside.card.tags') + site.tags.length)
48
48
  .length-num= site.tags.length
49
49
  .headline= _p('page.tag')
50
- if site.categories.length !== 0 && theme.page.categories
50
+ if site.categories.length !== 0 || theme.page.categories
51
51
  a(href=url_for('/categories/') title=_p('aside.card.categories') + site.categories.length)
52
52
  .length-num= site.categories.length
53
53
  .headline= _p('page.category')
@@ -16,16 +16,19 @@
16
16
  .tags-group-wrapper
17
17
  - const data = site.data.links.links
18
18
  - for (let i = 0; i < 2; i++)
19
+ - var links = []
19
20
  each x in data
20
- - var pairs = []
21
- each y, index in x.link_list
22
- if (index % 2 === 0)
23
- - pairs.push([y])
24
- else
25
- - pairs[pairs.length - 1].push(y)
26
- each pair in pairs
27
- .tags-group-icon-pair
28
- each y in pair
29
- a.tags-group-icon(href=url_for(y.link), title=y.name)
30
- img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
31
- span.tags-group-title=y.name
21
+ each y in x.link_list
22
+ - links.push(y)
23
+ - var pairs = []
24
+ each link, index in links
25
+ if (index % 2 === 0)
26
+ - pairs.push([link])
27
+ else
28
+ - pairs[pairs.length - 1].push(link)
29
+ each pair in pairs
30
+ .tags-group-icon-pair
31
+ each y in pair
32
+ a.tags-group-icon(href=url_for(y.link), title=y.name)
33
+ img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
34
+ span.tags-group-title=y.name
@@ -2,7 +2,7 @@
2
2
  if theme.rightside.hide.enable
3
3
  button.config(type='button' title=_p('rightside.show.gear') onclick='document.querySelector(".rs_hide").classList.toggle("show")')
4
4
  i.fas.fa-gear.fa-spin
5
- if page.toc
5
+ if showToc
6
6
  button.mobile.toc(type='button' title=_p('rightside.show.toc') onclick="document.querySelector('#card-toc').classList.toggle('open')")
7
7
  i.fas.fa-list
8
8
  if page.comment
@@ -1,3 +1,3 @@
1
1
  div.needEndHide#nav-music
2
2
  #nav-music-hoverTips(onclick='sco.musicToggle()')= __('music.hit')
3
- meting-js(id=theme.capsule.id server=theme.capsule.server type="playlist" mutex="true" preload="none" theme="var(--efu-main)" data-lrctype="0" order="random" volume=theme.capsule.volume)
3
+ meting-js(id=theme.capsule.id server=theme.capsule.server type=theme.capsule.type mutex="true" preload="none" theme="var(--efu-main)" data-lrctype="0" order="random" volume=theme.capsule.volume)
@@ -2,6 +2,9 @@
2
2
  .search-dialog
3
3
  .algolia-navbar
4
4
  .search-dialog__title#algolia-search-title=__('nav.search')
5
+ .algolia-tips
6
+ i.solitude.fab.fa-algolia
7
+ span.algolia-tips-text='Algolia'
5
8
  span.search-close-button
6
9
  i.solitude.fa-solid.fa-xmark
7
10
  #algolia-input-panel
package/layout/post.pug CHANGED
@@ -31,4 +31,5 @@ block content
31
31
  if page.comment
32
32
  - var comment_js = true
33
33
  include includes/widgets/third-party/comments/comment
34
- include includes/widgets/aside/aside
34
+ if page.aside
35
+ include includes/widgets/aside/aside
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
package/plugins.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  algolia_search:
2
2
  name: algoliasearch
3
- file: dist/algoliasearch-lite.umd.js
4
- version: 5.4.1
3
+ file: dist/algoliasearch.umd.js
4
+ version: 5.9.1
5
5
  instantsearch:
6
6
  name: instantsearch.js
7
7
  file: dist/instantsearch.production.min.js
@@ -142,6 +142,6 @@ hexo.extend.filter.register('before_generate', () => {
142
142
  themeConfig.cdn = Object.assign(
143
143
  createCDNLink(internalSrc, CDN.internal, 'internal'),
144
144
  createCDNLink(thirdPartySrc, CDN.third_party),
145
- deleteNullValue(CDN.option)
145
+ deleteNullValue(CDN.options)
146
146
  )
147
147
  })
@@ -5,7 +5,7 @@ hexo.extend.generator.register('404', function (locals) {
5
5
  layout: ['404'],
6
6
  data: {
7
7
  type: '404',
8
- comment: false
8
+ comment: false,
9
9
  }
10
10
  }
11
11
  })
@@ -16,7 +16,7 @@ hexo.extend.generator.register('tags', function(locals) {
16
16
  layout: ['page'],
17
17
  data: {
18
18
  type: 'tags',
19
- comment: false
19
+ comment: false,
20
20
  }
21
21
  };
22
22
  });
@@ -27,7 +27,7 @@ hexo.extend.generator.register('categories', function(locals) {
27
27
  layout: ['page'],
28
28
  data: {
29
29
  type: 'categories',
30
- comment: false
30
+ comment: false,
31
31
  }
32
32
  };
33
33
  });
@@ -11,7 +11,8 @@ hexo.extend.filter.register('after_post_render', function (data) {
11
11
  data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
12
12
  data.excerpt = data.description || data.excerpt
13
13
  data.toc = !!(config.aside.toc.post && data.toc !== false)
14
- data.ai = data.ai !== false
14
+ data.ai = data.ai !== false;
15
+ data.aside = data.aside || true;
15
16
  }
16
17
  if (data.layout === 'page') {
17
18
  let {cover} = hexo.theme.config.page.default
@@ -19,6 +20,7 @@ hexo.extend.filter.register('after_post_render', function (data) {
19
20
  data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
20
21
  data.excerpt = data.title
21
22
  data.toc = !!(config.aside.toc.page && data.toc !== false && data.aside);
23
+ data.aside = data.aside || false;
22
24
  }
23
25
  data.comment = !!(config.comment.use && data.comment !== false);
24
26
  return data;
@@ -15,4 +15,4 @@ const article = ([path]) => {
15
15
  return `<div class="recent-post-item" onclick="pjax.loadUrl('${'/' + post.path}')">${postCover + recentPostInfo}</div>`;
16
16
  }
17
17
 
18
- hexo.extend.tag.register('article', article)
18
+ hexo.extend.tag.register('article', article)
@@ -4,7 +4,7 @@
4
4
 
5
5
  'use strict'
6
6
 
7
- const typeit = ([tag, options], content) => {
7
+ const typeit = ([tag], content) => {
8
8
  const id = Math.random().toString(36).substr(2, 9);
9
9
  tag = tag || 'div';
10
10
  return `
@@ -15,8 +15,7 @@ const typeit = ([tag, options], content) => {
15
15
  const typeit = () => {
16
16
  const ctx = document.getElementById("typeit-${id}");
17
17
  if (!ctx) return;
18
- new TypeIt("#typeit-${id}", ${options})
19
- .type("${content}")
18
+ new TypeIt("#typeit-${id}", {${content}})
20
19
  .go();
21
20
  }
22
21
  document.addEventListener("DOMContentLoaded", typeit);
@@ -78,6 +78,15 @@ figure
78
78
  font-size 1.15em
79
79
  user-select none
80
80
 
81
+ .caption
82
+ position absolute
83
+ right 2.7rem
84
+ font-size 0.85em
85
+ color var(--efu-secondtext)
86
+
87
+ +maxWidth768()
88
+ display none
89
+
81
90
  .code-expand-btn
82
91
  background var(--efu-hltools-bg)
83
92
  transition .3s
@@ -1,4 +1,4 @@
1
- #article-container
1
+ .post-content
2
2
  overflow-wrap break-word
3
3
  +maxWidth768()
4
4
  overflow hidden
@@ -66,6 +66,7 @@
66
66
  border-radius 8px
67
67
  align-items center
68
68
  height 30px
69
+ scrollbar-width: none
69
70
  +maxWidth768()
70
71
  height 44px
71
72
  gap 6px
@@ -20,9 +20,13 @@ if hexo-config('carousel')
20
20
  if hexo-config('aside.position') == 0
21
21
  #home
22
22
  order 2
23
+ #page
24
+ order 2
23
25
  else
24
26
  #home
25
27
  order 1
28
+ #page
29
+ order 1
26
30
 
27
31
  if hexo-config('comment.hot_tip.enable')
28
32
  @import "hot-tip.styl"
@@ -19,7 +19,7 @@
19
19
  width 300px
20
20
  bottom -100px
21
21
  right 20px
22
- z-index 7
22
+ z-index 12
23
23
  height fit-content
24
24
  transition cubic-bezier(.42, 0, .3, 1.11) .3s
25
25
  border var(--style-border)
@@ -7,12 +7,14 @@
7
7
  margin-left -15rem
8
8
  padding 1rem
9
9
  width 30rem
10
+ flex-direction column
10
11
  box-shadow var(--efu-shadow-lightblack)
11
12
  background var(--efu-card-bg)
12
13
  border var(--style-border)
13
14
  transition 0.3s
14
15
  border-radius 8px
15
16
  animation slide-in .6s ease 0s 1 normal none running
17
+ gap: 16px
16
18
 
17
19
  &:hover
18
20
  border var(--style-border-hover)
@@ -31,12 +33,10 @@
31
33
  .algolia-navbar
32
34
  display flex
33
35
  align-items center
34
- margin-bottom 8px
35
36
 
36
37
  .search-close-button
37
- position absolute
38
- top 0.8rem
39
- right 1rem
38
+ margin-left: 4px
39
+ padding 4px
40
40
  color var(--efu-gray)
41
41
  font-size 1.4em
42
42
  line-height 1
@@ -49,9 +49,6 @@
49
49
  .algolia-tips-text
50
50
  margin-left .4rem
51
51
 
52
- #algolia-input-panel
53
- margin-bottom 8px
54
-
55
52
  .search-box, .ais-SearchBox
56
53
  padding-top 8px
57
54
  max-width 100%
@@ -77,7 +74,6 @@
77
74
  visibility hidden
78
75
 
79
76
  #search-results
80
- padding-top 8px
81
77
  max-height calc(80vh - 130px)
82
78
  overflow-y auto
83
79
 
@@ -86,9 +82,7 @@
86
82
 
87
83
  .ais-Hits-list
88
84
  padding 0
89
-
90
- .ais-Hits-item
91
- margin 10px 0
85
+ margin 0
92
86
 
93
87
  .algolia-hit-item-content
94
88
  margin 0
@@ -104,17 +98,21 @@
104
98
  overflow hidden
105
99
  font-weight bold
106
100
 
101
+ &:hover
102
+ color var(--efu-main)
103
+
104
+ .ais-Stats-text
105
+ font-size 12px
106
+
107
107
  mark
108
108
  color var(--efu-theme)
109
109
  font-style normal
110
110
  background var(--efu-card-bg)
111
111
 
112
112
  .ais-Hits--empty
113
- text-align center
114
113
  font-weight 600
115
114
 
116
115
  .ais-Pagination-list
117
- margin 0.2rem 0 0
118
116
  padding 0
119
117
  text-align center
120
118
 
@@ -134,15 +132,13 @@
134
132
 
135
133
  .search-dialog__title
136
134
  font-weight 700
137
- padding 0 0 0.7rem
138
135
  color var(--efu-main)
139
136
  font-size 1.4em
140
137
  line-height 1
141
138
 
142
139
  #algolia-tips
143
- padding-top 12px
144
140
  color var(--efu-secondtext)
145
- right 0
141
+ width 100%
146
142
  margin auto
147
143
 
148
144
  .algolia-tips-text
@@ -173,3 +169,14 @@
173
169
 
174
170
  .ais-Pagination-item--selected a
175
171
  background var(--efu-main)
172
+
173
+ .algolia-tips
174
+ color: var(--efu-secondtext);
175
+ margin-left: auto;
176
+ opacity: .8;
177
+
178
+ i
179
+ font-size: 18px
180
+
181
+ #algolia-search .search-dialog .ais-SearchBox-input::placeholder
182
+ opacity: .6
@@ -13,6 +13,8 @@
13
13
  transition 0.3s
14
14
  border-radius 8px
15
15
  animation slide-in .6s ease 0s 1 normal none running
16
+ gap 16px
17
+ flex-direction: column
16
18
 
17
19
  &:hover
18
20
  border var(--style-border-hover)
@@ -31,14 +33,10 @@
31
33
  .search-dialog-title
32
34
  font-weight 700
33
35
  color var(--efu-main)
34
- padding 0 0 0.7rem
35
36
  font-size 1.4em
36
37
  line-height 1
37
38
 
38
39
  .search-close-button
39
- position absolute
40
- top 0.8rem
41
- right 1rem
42
40
  color var(--efu-gray)
43
41
  font-size 1.4em
44
42
  line-height 1
@@ -77,7 +75,6 @@
77
75
 
78
76
  #search-pagination
79
77
  .pagination-list
80
- margin 0.2rem 0 0
81
78
  padding 0
82
79
  text-align center
83
80
 
@@ -103,13 +100,13 @@
103
100
  color var(--efu-white)
104
101
 
105
102
  #search-tips
106
- padding-top 12px
107
103
  color var(--efu-secondtext)
108
104
  right 0
109
105
  margin auto
110
106
 
111
107
  .search-result-count
112
108
  color var(--efu-gray)
109
+ font-size 12px
113
110
 
114
111
  b
115
112
  color var(--efu-main)
@@ -119,8 +116,6 @@
119
116
  margin 0 auto
120
117
  max-width 100%
121
118
  width 100%
122
- padding-top 8px
123
- padding-bottom 8px
124
119
 
125
120
  input
126
121
  height 100%
@@ -133,9 +128,9 @@
133
128
  color var(--efu-fontcolor)
134
129
  caret-color var(--efu-theme)
135
130
 
136
- ::placeholder
131
+ &::placeholder
137
132
  color var(--efu-gray)
138
- opacity .5
133
+ opacity .8
139
134
 
140
135
  #search-mask
141
136
  position fixed
@@ -158,4 +153,9 @@
158
153
 
159
154
  &:hover
160
155
  background var(--efu-main)
161
- color var(--efu-white)
156
+ color var(--efu-white)
157
+
158
+ .search-nav
159
+ display: flex
160
+ justify-content: space-between
161
+ align-content: center
@@ -1,7 +1,6 @@
1
1
  #article-container
2
2
  figure.gallery-group
3
3
  position: relative
4
- float: left
5
4
  overflow: hidden
6
5
  margin: 0
7
6
  width: calc(50% - 8px)
package/source/js/main.js CHANGED
@@ -524,9 +524,15 @@ const addHighlight = () => {
524
524
  const createEle = (lang, item, service) => {
525
525
  const fragment = document.createDocumentFragment()
526
526
  if ($isShowTool) {
527
+ const captionItem = item.querySelector('figcaption')
528
+ let caption = ''
529
+ if (captionItem) {
530
+ caption = `<div class="caption">${captionItem.innerHTML}</div>`
531
+ item.removeChild(captionItem)
532
+ }
527
533
  const hlTools = document.createElement('div')
528
534
  hlTools.className = `highlight-tools ${expandClass}`
529
- hlTools.innerHTML = expandEle + lang + copyEle
535
+ hlTools.innerHTML = expandEle + lang + caption + copyEle
530
536
  utils.addEventListenerPjax(hlTools, 'click', ToolsFn)
531
537
  fragment.appendChild(hlTools)
532
538
  }
@@ -689,7 +695,7 @@ class tabs {
689
695
  if (expire.time > ex) return;
690
696
  const ele = document.createElement('div');
691
697
  ele.className = 'expire';
692
- ele.innerHTML = `<i class="solitude st-circle-exclamation-solid"></i>${expire.text_prev}${-(expire.time - ex)}${expire.text_next}`;
698
+ ele.innerHTML = `<i class="solitude fas fa-circle-exclamation"></i>${expire.text_prev}${-(expire.time - ex)}${expire.text_next}`;
693
699
  const articleContainer = document.getElementById('article-container');
694
700
  articleContainer.insertAdjacentElement(expire.position === 'top' ? 'afterbegin' : 'beforeend', ele);
695
701
  }
@@ -1,10 +1,10 @@
1
- window.addEventListener("load", () => {
1
+ document.addEventListener("DOMContentLoaded", function () {
2
2
  const $searchMask = document.getElementById("search-mask");
3
3
  const $searchDialog = document.querySelector("#algolia-search .search-dialog");
4
4
 
5
5
  window.openSearch = () => {
6
6
  utils.animateIn($searchMask, "to_show 0.5s");
7
- $searchDialog.style.display = "block";
7
+ $searchDialog.style.display = "flex";
8
8
  setTimeout(() => {
9
9
  document.querySelector("#algolia-search .ais-SearchBox-input").focus();
10
10
  }, 100);
@@ -68,12 +68,14 @@ window.addEventListener("load", () => {
68
68
 
69
69
  const search = instantsearch({
70
70
  indexName: algolia.indexName,
71
- searchClient: algoliasearch(algolia.appId, algolia.apiKey),
71
+ searchClient: algoliasearch.algoliasearch(algolia.appId, algolia.apiKey),
72
72
  searchFunction(helper) {
73
73
  if (helper.state.query) {
74
- let innerLoading = '<i class="solitude st-loading-line st-spin"></i>';
74
+ let innerLoading = `<div class="loading">${GLOBAL_CONFIG.lang.search.loading}</div>`;
75
75
  document.getElementById("algolia-hits").innerHTML = innerLoading;
76
76
  helper.search();
77
+ } else {
78
+ document.getElementById("algolia-hits").innerHTML = '';
77
79
  }
78
80
  },
79
81
  });
@@ -87,9 +89,8 @@ window.addEventListener("load", () => {
87
89
  showReset: false,
88
90
  showSubmit: false,
89
91
  placeholder: GLOBAL_CONFIG.lang.search.placeholder,
90
- showLoadingIndicator: true,
91
- searchOnEnterKeyPressOnly: true,
92
- searchAsYouType: false,
92
+ showLoadingIndicator: false,
93
+ searchAsYouType: true,
93
94
  });
94
95
 
95
96
  const hits = instantsearch.widgets.hits({
@@ -98,7 +99,7 @@ window.addEventListener("load", () => {
98
99
  item(data) {
99
100
  const link = data.permalink ? data.permalink : GLOBAL_CONFIG.root + data.path;
100
101
  const result = data._highlightResult;
101
- const loadingLogo = document.querySelector("#algolia-hits .st-spin");
102
+ const loadingLogo = document.querySelector("#algolia-hits .loading");
102
103
  if (loadingLogo) {
103
104
  loadingLogo.style.display = "none";
104
105
  }
@@ -111,7 +112,7 @@ window.addEventListener("load", () => {
111
112
  </a>`;
112
113
  },
113
114
  empty: function (data) {
114
- const loadingLogo = document.querySelector("#algolia-hits .st-spin");
115
+ const loadingLogo = document.querySelector("#algolia-hits .loading");
115
116
  if (loadingLogo) {
116
117
  loadingLogo.style.display = "none";
117
118
  }
@@ -136,10 +137,10 @@ window.addEventListener("load", () => {
136
137
  scrollTo: false,
137
138
  showFirstLast: false,
138
139
  templates: {
139
- first: '<i class="solitude st-show-left-line"></i>',
140
- last: '<i class="solitude st-show-right-line"></i>',
141
- previous: '<i class="solitude st-arrow-left-bold"></i>',
142
- next: '<i class="solitude st-arrow-right-bold"></i>',
140
+ first: '<i class="solitude fas fa-angles-left"></i>',
141
+ last: '<i class="solitude fas fa-angles-right"></i>',
142
+ previous: '<i class="solitude fas fa-angle-left"></i>',
143
+ next: '<i class="solitude fas fa-angle-right"></i>',
143
144
  },
144
145
  cssClasses: {
145
146
  root: "pagination",
@@ -162,7 +163,7 @@ window.addEventListener("load", () => {
162
163
  },
163
164
  });
164
165
 
165
- search.addWidgets([configure, searchBox,stats, hits, pagination]);
166
+ search.addWidgets([configure, searchBox, stats, hits, pagination]);
166
167
 
167
168
  search.start();
168
169
 
@@ -178,4 +179,4 @@ window.addEventListener("load", () => {
178
179
  search.on("render", () => {
179
180
  window.pjax.refresh(document.getElementById("algolia-hits"));
180
181
  });
181
- });
182
+ });
@@ -4,7 +4,7 @@ window.addEventListener("load", () => {
4
4
  const $searchDialog = document.querySelector("#local-search .search-dialog");
5
5
  window.openSearch = () => {
6
6
  utils.animateIn($searchMask, "to_show 0.5s");
7
- $searchDialog.style.display = "block";
7
+ $searchDialog.style.display = "flex";
8
8
  setTimeout(() => {
9
9
  document.querySelector("#local-search .search-box-input").focus();
10
10
  }, 100);
@@ -101,18 +101,15 @@ window.addEventListener("load", () => {
101
101
  function initUI() {
102
102
  const $results = document.getElementById("search-results");
103
103
  const $search = document.getElementById("search-input");
104
- $search.addEventListener('keydown', function (e) {
105
- if (e.keyCode === 13) {
106
- e.preventDefault();
107
- $results.innerHTML = '';
108
- query = this.value.trim();
109
- if (query !== '') {
110
- results = search(query);
111
- renderResults(results, currentPage);
112
- renderPagination(results.length);
113
- } else {
114
- clearSearchResults();
115
- }
104
+ $search.addEventListener('input', function (e) {
105
+ $results.innerHTML = '';
106
+ query = this.value.trim();
107
+ if (query !== '') {
108
+ results = search(query);
109
+ renderResults(results, currentPage);
110
+ renderPagination(results.length);
111
+ } else {
112
+ clearSearchResults();
116
113
  }
117
114
  });
118
115
  }
@@ -202,4 +199,4 @@ window.addEventListener("load", () => {
202
199
  window.addEventListener('pjax:complete', () => {
203
200
  searchClickFn()
204
201
  })
205
- });
202
+ });