hexo-theme-solitude 3.0.15 → 3.0.17

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.
package/README.md CHANGED
@@ -6,21 +6,19 @@
6
6
 
7
7
  一款优雅的 Hexo 主题,支持懒加载、PWA、Latex 以及多种评论系统。
8
8
 
9
- 主题设计由 [@张洪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)
12
12
  ![license](https://img.shields.io/github/license/everfu/hexo-theme-solitude?color=FF5531)
13
13
  [![Stars](https://img.shields.io/github/stars/everfu/hexo-theme-solitude)](https://github.com/everfu/hexo-theme-solitude/stargazers)
14
- [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude
15
- )](https://www.npmjs.com/package/hexo-theme-solitude)
14
+ [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude)](https://www.npmjs.com/package/hexo-theme-solitude)
16
15
 
17
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white)
18
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white)
19
18
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-white?logo=jetbrains)
20
19
 
21
20
  ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&color=blue)
22
- ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude
23
- )
21
+ ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude)
24
22
  ![npm publish](https://img.shields.io/github/actions/workflow/status/everfu/hexo-theme-solitude/npm-publish.yml)
25
23
 
26
24
  </div>
@@ -41,17 +39,17 @@
41
39
 
42
40
  1. 使用 NPM 包进行安装
43
41
 
44
- ```bash
45
- npm i hexo-theme-solitude
46
- ```
42
+ ```bash
43
+ npm i hexo-theme-solitude
44
+ ```
47
45
 
48
46
  2. 应用主题
49
47
 
50
- ```yaml
51
- theme: solitude
52
- ```
48
+ ```yaml
49
+ theme: solitude
50
+ ```
53
51
 
54
- 前往 [文档](https://solitude.js.org/zh/) 获取更多信息。
52
+ 前往 [文档](https://solitude.js.org/) 获取更多信息。
55
53
 
56
54
  ## 社区
57
55
 
package/README_en-US.md CHANGED
@@ -1,4 +1,4 @@
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
 
@@ -11,16 +11,14 @@ Theme design fully authorized by [@Zhang Hong Heo](https://github.com/zhheo)
11
11
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude)
12
12
  ![license](https://img.shields.io/github/license/everfu/hexo-theme-solitude?color=FF5531)
13
13
  [![Stars](https://img.shields.io/github/stars/everfu/hexo-theme-solitude)](https://github.com/everfu/hexo-theme-solitude/stargazers)
14
- [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude
15
- )](https://www.npmjs.com/package/hexo-theme-solitude)
14
+ [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude)](https://www.npmjs.com/package/hexo-theme-solitude)
16
15
 
17
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white)
18
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white)
19
18
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-white?logo=jetbrains)
20
19
 
21
20
  ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&color=blue)
22
- ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude
23
- )
21
+ ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude)
24
22
  ![npm publish](https://img.shields.io/github/actions/workflow/status/everfu/hexo-theme-solitude/npm-publish.yml)
25
23
 
26
24
  </div>
@@ -41,17 +39,17 @@ Theme design fully authorized by [@Zhang Hong Heo](https://github.com/zhheo)
41
39
 
42
40
  1. Install using the NPM package
43
41
 
44
- ```bash
45
- npm i hexo-theme-solitude
46
- ```
42
+ ```bash
43
+ npm i hexo-theme-solitude
44
+ ```
47
45
 
48
46
  2. Apply the theme
49
47
 
50
- ```yaml
51
- theme: solitude
52
- ```
48
+ ```yaml
49
+ theme: solitude
50
+ ```
53
51
 
54
- Visit [Documentation](https://solitude.js.org/zh/) for more information.
52
+ Visit [Documentation](https://solitude.js.org/) for more information.
55
53
 
56
54
  ## Community
57
55
 
package/README_zh-Hant.md CHANGED
@@ -6,21 +6,19 @@
6
6
 
7
7
  一款優雅的 Hexo 主題,支持懶加載、PWA、Latex 以及多種評論系統。
8
8
 
9
- 主題設計由 [@張洪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)
12
12
  ![license](https://img.shields.io/github/license/everfu/hexo-theme-solitude?color=FF5531)
13
13
  [![Stars](https://img.shields.io/github/stars/everfu/hexo-theme-solitude)](https://github.com/everfu/hexo-theme-solitude/stargazers)
14
- [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude
15
- )](https://www.npmjs.com/package/hexo-theme-solitude)
14
+ [![NPM all downloads](https://img.shields.io/npm/d18m/hexo-theme-solitude)](https://www.npmjs.com/package/hexo-theme-solitude)
16
15
 
17
16
  ![hexo version](https://img.shields.io/badge/hexo-7.0.0+-blue?logo=hexo&logoColor=white)
18
17
  ![node version](https://img.shields.io/badge/node-14.0.0+-white?logo=node.js&logoColor=white)
19
18
  ![JetBrains](https://img.shields.io/badge/jetbrains-support-white?logo=jetbrains)
20
19
 
21
20
  ![page view](https://komarev.com/ghpvc/?username=hexo-theme-solitude&color=blue)
22
- ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude
23
- )
21
+ ![jsdelivr](https://img.shields.io/jsdelivr/npm/hd/hexo-theme-solitude)
24
22
  ![npm publish](https://img.shields.io/github/actions/workflow/status/everfu/hexo-theme-solitude/npm-publish.yml)
25
23
 
26
24
  </div>
@@ -41,17 +39,17 @@
41
39
 
42
40
  1. 使用 NPM 包進行安裝
43
41
 
44
- ```bash
45
- npm i hexo-theme-solitude
46
- ```
42
+ ```bash
43
+ npm i hexo-theme-solitude
44
+ ```
47
45
 
48
46
  2. 應用主題
49
47
 
50
- ```yaml
51
- theme: solitude
52
- ```
48
+ ```yaml
49
+ theme: solitude
50
+ ```
53
51
 
54
- 前往 [文檔](https://solitude.js.org/zh/) 獲取更多信息。
52
+ 前往 [文檔](https://solitude.js.org/) 獲取更多信息。
55
53
 
56
54
  ## 社區
57
55
 
package/languages/en.yml CHANGED
File without changes
File without changes
File without changes
@@ -66,7 +66,7 @@ div#footer-bar
66
66
  a.footer-bar-link(href=url_for(item.url), title=item.name)
67
67
  if item.icon
68
68
  img.beian-icon(src=url_for(item.icon), alt=item.name)
69
- span.beian-name= item.name
69
+ span.beian-name= item.name
70
70
  a.footer-bar-link(href=_p('hexo'))
71
71
  = _p('framework_by') + 'Hexo'
72
72
  a.footer-bar-link(href=_p('repo'))
@@ -20,7 +20,10 @@ if theme.brevity.enable
20
20
  if item.image
21
21
  .bber-content-img
22
22
  each img in item.image
23
- img(src=img alt="image")
23
+ if typeof img === 'string'
24
+ img(src=img, alt=item.content || "图片暂无描述")
25
+ else
26
+ img(src=img.url, alt=(img.alt || item.content || "图片暂无描述"))
24
27
 
25
28
  if item.aplayer
26
29
  .bber-music
@@ -79,5 +79,4 @@
79
79
  i.solitude.fas.fa-spinner.fa-spin
80
80
  when 'Artalk'
81
81
  span.artalk-count
82
- i.solitude.fas.fa-spinner.fa-spin
83
- #post-info-bottom
82
+ i.solitude.fas.fa-spinner.fa-spin
@@ -3,8 +3,8 @@
3
3
 
4
4
  script(pjax).
5
5
  (async () => {
6
- await fetch('!{theme.waline.envId}/api/comment?type=recent&count=-1', {method: 'GET'}).then(async res => res.json())
6
+ await fetch('!{theme.waline.envId}/api/comment?type=count', {method: 'GET'}).then(async res => res.json())
7
7
  .then(async data => {
8
- document.querySelector('#waline_allcount').innerHTML = data.length
8
+ document.querySelector('#waline_allcount').innerHTML = data.data
9
9
  })
10
- })()
10
+ })()
@@ -6,4 +6,6 @@ if use
6
6
  when 'Twikoo'
7
7
  include ./twikoo
8
8
  when 'Artalk'
9
- include ./artalk
9
+ include ./artalk
10
+ when 'Waline'
11
+ include ./waline
@@ -0,0 +1,47 @@
1
+ script.
2
+ function updatePostsBasedOnComments() {
3
+ const location = window.location.origin;
4
+ const posts = Array.from(document.querySelectorAll('.recent-post-item[onclick] .post_cover a'))
5
+ .map(item => item.href.replace(location, ''));
6
+ const fetchCommentsCount = () => {
7
+ const requests = posts.map(url => {
8
+ return fetch(`#{theme.waline.envId}/api/comment?type=count&url=${encodeURIComponent(url)}`)
9
+ .then(response => response.json())
10
+ .then(data => ({
11
+ url: url,
12
+ count: data.errno === 0 ? data.data[0] : 0
13
+ }));
14
+ });
15
+ Promise.all(requests)
16
+ .then(handleCommentsResponse)
17
+ .catch(error => console.error("Error fetching comments:", error));
18
+ };
19
+ const handleCommentsResponse = (response) => {
20
+ response.forEach(({ url, count }) => {
21
+ if (count > #{count}) {
22
+ const postElement = document.querySelector(`.recent-post-item[onclick*="${url}"]`);
23
+ if (postElement) updatePostElement(postElement);
24
+ }
25
+ });
26
+ };
27
+ const updatePostElement = (postElement) => {
28
+ const infoTopTips = postElement.querySelector(".recent-post-info-top-tips");
29
+ const originalSpan = infoTopTips?.querySelector(".original");
30
+ const existingHotTip = infoTopTips?.querySelector(".hot-tip");
31
+ if (!existingHotTip && originalSpan) {
32
+ const hotTip = createHotTipElement();
33
+ infoTopTips.insertBefore(hotTip, originalSpan);
34
+ }
35
+ };
36
+ const createHotTipElement = () => {
37
+ const hotTip = document.createElement("span");
38
+ hotTip.classList.add("hot-tip");
39
+ const icon = document.createElement("i");
40
+ icon.classList.add("solitude", "fas", "fa-fire-flame-curved");
41
+ hotTip.appendChild(icon);
42
+ const commentCount = document.createTextNode("#{_p('hot-tip')}");
43
+ hotTip.appendChild(commentCount);
44
+ return hotTip;
45
+ };
46
+ fetchCommentsCount();
47
+ }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "3.0.15",
3
+ "version": "3.0.17",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
5
5
  "main": "package.json",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
6
  "keywords": [
10
7
  "hexo",
11
8
  "theme",
@@ -29,5 +26,8 @@
29
26
  },
30
27
  "homepage": "https://solitude.js.org",
31
28
  "author": "Hexo-Theme-Solitude<o@efu.me>",
32
- "license": "Apache-2.0"
33
- }
29
+ "license": "Apache-2.0",
30
+ "scripts": {
31
+ "test": "echo \"Error: no test specified\" && exit 1"
32
+ }
33
+ }
package/plugins.yml CHANGED
@@ -50,12 +50,12 @@ katex:
50
50
  name: katex
51
51
  file: dist/katex.min.css
52
52
  other_name: KaTeX
53
- version: 0.16.21
53
+ version: 0.16.9
54
54
  katex_copytex:
55
55
  name: katex
56
56
  file: dist/contrib/copy-tex.min.js
57
57
  other_name: KaTeX
58
- version: 0.16.21
58
+ version: 0.16.9
59
59
  lazyload:
60
60
  name: vanilla-lazyload
61
61
  file: dist/lazyload.iife.min.js
@@ -121,7 +121,7 @@ mermaid_js:
121
121
  chart_js:
122
122
  name: chart.js
123
123
  file: dist/chart.umd.js
124
- version: 4.4.7
124
+ version: 4.4.1
125
125
  other_name: Chart.js
126
126
  typeit_js:
127
127
  name: typeit
@@ -380,7 +380,6 @@ i.solitude
380
380
  &#content-inner
381
381
  max-width 1400px
382
382
  flex-grow 1
383
- padding-top .5rem
384
383
 
385
384
  &.hide-aside
386
385
  > div:first-child
@@ -396,19 +395,12 @@ i.solitude
396
395
  width 100%
397
396
 
398
397
  > #post, #category, #tag, #archive
399
- box-shadow var(--efu-shadow-border)
400
- padding 1rem 2rem
401
- border-radius 12px
402
- border var(--style-border)
403
398
  align-self flex-start
404
399
  animation slide-in .6s .1s backwards
405
400
  position relative
406
401
  if hexo-config('aside.position') == 0
407
402
  order 2
408
403
 
409
- +minWidth768()
410
- background var(--efu-card-bg)
411
-
412
404
  +maxWidth768()
413
405
  box-shadow none
414
406
  border none
@@ -1,5 +1,10 @@
1
1
  .article-container
2
2
  overflow-wrap break-word
3
+ #post &
4
+ border var(--style-border)
5
+ border-radius var(--radius)
6
+ box-shadow var(--efu-shadow-border)
7
+ background var(--efu-card-bg)
3
8
  +maxWidth768()
4
9
  overflow hidden
5
10
 
@@ -42,7 +42,7 @@
42
42
  display none
43
43
 
44
44
  +maxHeight800()
45
- display none
45
+ padding-top 30px
46
46
 
47
47
 
48
48
  &.show
@@ -84,6 +84,8 @@
84
84
 
85
85
  .console-card.tags
86
86
  height calc(100% - 172px)
87
+ +maxHeight800()
88
+ height 100%
87
89
 
88
90
  .console-mask
89
91
  background var(--efu-maskbgdeep)
@@ -227,11 +229,11 @@
227
229
  line-height 1
228
230
  transform rotate(-30deg)
229
231
  transition .6s
232
+ border-radius 32px
230
233
 
231
234
  i:hover
232
235
  color var(--efu-hovertext)
233
236
  background var(--efu-main-op)
234
- border-radius 32px
235
237
 
236
238
  .console-card.history
237
239
  margin-top 8px
@@ -242,6 +244,9 @@
242
244
  overflow hidden
243
245
  border-radius 0
244
246
 
247
+ +maxHeight800()
248
+ display none
249
+
245
250
  .item-headline
246
251
  display none
247
252
 
@@ -1,8 +1,9 @@
1
1
  #category
2
2
  #category-bar
3
- padding 0
3
+ padding .4rem .6rem
4
4
  border none
5
5
  height auto
6
+ border var(--style-border)
6
7
  box-shadow none
7
8
 
8
9
  +maxWidth768()
@@ -173,6 +173,17 @@ div#banners
173
173
  margin-top 0
174
174
  margin-bottom: 12px
175
175
 
176
+ &::before
177
+ content ''
178
+ position absolute
179
+ width 100%
180
+ height 100%
181
+ background var(--efu-black)
182
+ opacity .3
183
+ z-index 1
184
+ top 0
185
+ left 0
186
+
176
187
  .author-content-item
177
188
  flex 4
178
189
  border-radius 12px
@@ -28,7 +28,6 @@ div.console_recentcomments
28
28
 
29
29
  +maxWidth1300()
30
30
  min-width 100%
31
- height calc(100% / 3 - 8px)
32
31
 
33
32
  +maxWidth768()
34
33
  width 100%
@@ -1,8 +1,4 @@
1
1
  #tag
2
- +minWidth1300()
3
- padding: 4rem 2rem 1rem 2rem!important
4
- overflow hidden
5
-
6
2
  +maxWidth768()
7
3
  padding 0 1rem
8
4
 
@@ -10,19 +6,18 @@
10
6
  display flex
11
7
  flex-direction row
12
8
  flex-wrap wrap
13
- margin 0
14
- margin-bottom 0.5rem
15
- position absolute
16
- z-index 2
17
9
  width 100%
18
- padding 1rem 2rem
10
+ position absolute
11
+ z-index 1
19
12
  left 0
20
13
  top 0
21
- max-height 64px
22
- overflow hidden
14
+ max-height 44px
15
+ overflow: hidden
23
16
  background var(--efu-card-bg)
24
17
  backdrop-filter saturate(180%) blur(20px)
25
18
  transition .1s ease-out
19
+ border-radius 12px
20
+ border var(--style-border-always)
26
21
 
27
22
  &:hover
28
23
  max-height 1000px
@@ -34,6 +34,17 @@
34
34
 
35
35
  +maxWidth768()
36
36
  height 15rem
37
+ &::after
38
+ position absolute
39
+ content ''
40
+ width 100%
41
+ height 32px
42
+ background var(--efu-background)
43
+ bottom 0
44
+ border-radius 16px 16px 0 0
45
+
46
+ +maxWidth768()
47
+ display none
37
48
 
38
49
  .post-bg
39
50
  #post-cover
@@ -342,13 +353,4 @@
342
353
  background var(--efu-hovertext)
343
354
  border-radius 12px 12px 0 0
344
355
  +minWidth768()
345
- min-height 250px
346
-
347
- #post-info-bottom
348
- display flex
349
- position absolute
350
- width 100%
351
- bottom 0
352
- border-radius 1rem 1rem 0 0
353
- padding .5rem 0
354
- background var(--efu-background)
356
+ min-height 250px
package/source/js/main.js CHANGED
@@ -903,12 +903,7 @@ window.refreshFn = () => {
903
903
  const { is_home, is_page, page, is_post, ai_text } = PAGE_CONFIG;
904
904
  const { runtime, lazyload, lightbox, randomlink, covercolor, lure, expire } =
905
905
  GLOBAL_CONFIG;
906
- const timeSelector =
907
- (is_home || is_page
908
- ? ".post-meta-date time"
909
- : is_post
910
- ? ".post-meta-date time"
911
- : ".datetime") + ", .webinfo-item time";
906
+ const timeSelector = ".datetime, .webinfo-item time, .post-meta-date time";
912
907
  document.body.setAttribute("data-type", page);
913
908
  sco.changeTimeFormat(document.querySelectorAll(timeSelector));
914
909
  runtime && sco.addRuntime();