hexo-theme-solitude 2.0.9 → 2.0.11

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 (39) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +1 -8
  2. package/CONTRIBUTING.md +1 -1
  3. package/LICENSE +1 -1
  4. package/README.md +1 -1
  5. package/README_zh-Hans.md +3 -3
  6. package/README_zh-Hant.md +2 -2
  7. package/SECURITY.md +4 -4
  8. package/_config.yml +20 -29
  9. package/layout/includes/console.pug +1 -1
  10. package/layout/includes/inject/body.pug +104 -100
  11. package/layout/includes/nav.pug +2 -2
  12. package/layout/includes/widgets/aside/aside.pug +1 -1
  13. package/layout/includes/widgets/home/postList.pug +1 -20
  14. package/layout/includes/widgets/home/topGroup.pug +5 -5
  15. package/layout/includes/widgets/page/links/banner.pug +1 -2
  16. package/layout/includes/widgets/post/copyright.pug +1 -1
  17. package/layout/includes/widgets/randomlink.pug +1 -2
  18. package/package.json +5 -4
  19. package/plugins.yml +16 -5
  20. package/scripts/event/merge_config.js +415 -423
  21. package/scripts/helper/inject_head_js.js +13 -7
  22. package/scripts/tags/article.js +39 -0
  23. package/scripts/tags/chart.js +27 -0
  24. package/scripts/tags/gallery.js +1 -1
  25. package/scripts/tags/typeit.js +29 -0
  26. package/source/css/_global/function.styl +1 -1
  27. package/source/css/_layout/article-container.styl +2 -2
  28. package/source/css/_layout/console.styl +7 -4
  29. package/source/css/_layout/recent-post.styl +53 -75
  30. package/source/css/_page/_home/home-top.styl +8 -13
  31. package/source/css/_page/recentcomment.styl +1 -3
  32. package/source/css/_post/meta.styl +2 -2
  33. package/source/css/_tags/gallery.styl +2 -1
  34. package/source/css/var.styl +7 -7
  35. package/source/js/covercolor/local.js +10 -82
  36. package/source/js/main.js +1 -1
  37. package/source/js/utils.js +1 -7
  38. package/.editorconfig +0 -9
  39. package/.github/workflows/stale.yml +0 -19
@@ -21,13 +21,13 @@ hexo.extend.helper.register('inject_head_js', function () {
21
21
  },
22
22
  get: function getWithExpiry(key) {
23
23
  const itemStr = localStorage.getItem(key)
24
-
24
+
25
25
  if (!itemStr) {
26
26
  return undefined
27
27
  }
28
28
  const item = JSON.parse(itemStr)
29
29
  const now = new Date()
30
-
30
+
31
31
  if (now.getTime() > item.expiry) {
32
32
  localStorage.removeItem(key)
33
33
  return undefined
@@ -62,24 +62,30 @@ hexo.extend.helper.register('inject_head_js', function () {
62
62
  script.onload = script.onreadystatechange = null
63
63
  resolve()
64
64
  }
65
-
65
+
66
66
  Object.keys(attr).forEach(key => {
67
67
  script.setAttribute(key, attr[key])
68
68
  })
69
-
69
+
70
70
  document.head.appendChild(script)
71
71
  }),
72
72
  addGlobalFn: (key, fn, name = false, parent = window) => {
73
73
  const globalFn = parent.globalFn || {}
74
74
  const keyObj = globalFn[key] || {}
75
-
75
+
76
76
  if (name && keyObj[name]) return
77
-
77
+
78
78
  name = name || Object.keys(keyObj).length
79
79
  keyObj[name] = fn
80
80
  globalFn[key] = keyObj
81
81
  parent.globalFn = globalFn
82
82
  },
83
+ addEventListenerPjax: (ele, event, fn, option = false) => {
84
+ ele.addEventListener(event, fn, option)
85
+ utils.addGlobalFn('pjax', () => {
86
+ ele.removeEventListener(event, fn, option)
87
+ })
88
+ },
83
89
  }
84
90
  `
85
91
  return `<script>(()=>{${createJS()}})()</script>`
@@ -88,4 +94,4 @@ hexo.extend.helper.register('inject_head_js', function () {
88
94
  hexo.extend.helper.register('packageVersion', function () {
89
95
  const {version} = require('../../package.json')
90
96
  return version
91
- })
97
+ })
@@ -0,0 +1,39 @@
1
+ 'use strict'
2
+
3
+ const article = ([path]) => {
4
+ const post = hexo.locals.get("posts").data.find(post => post.path === path);
5
+ if (!post) {
6
+ return '';
7
+ }
8
+ const tags = post.tags.map(tag => `<a class="article-meta__tags fancybox" href="${tag.path}" onclick="event.stopPropagation();"><span class="tags-punctuation"><i class="solitude fa-solid fa-hashtag"></i>${tag.name}</span></a>`).join('');
9
+ const category = post.categories.data.length > 0 ? `<span class="article-meta sticky-warp"><span class="original">${post.categories.data[0].name}</span></span>` : '';
10
+ return `
11
+ <div class="recent-post-item" onclick="pjax.loadUrl('${post.path}')">
12
+ <div class="post_cover">
13
+ <a href="${post.path}" class="fancybox" title="${post.title}">
14
+ <img class="post_bg" src="${post.cover}" alt="${post.title}">
15
+ </a>
16
+ </div>
17
+ <div class="recent-post-info">
18
+ <div class="recent-post-info-top">
19
+ <div class="recent-post-info-top-tips">
20
+ ${category}
21
+ </div>
22
+ <a class="article-title fancybox" href="${post.path}" title="${post.title}">${post.title}</a>
23
+ </div>
24
+ <div class="content">
25
+ ${post.description ? post.description : ''}
26
+ </div>
27
+ <div class="article-meta-wrap">
28
+ <span class="article-meta tags">
29
+ ${tags}
30
+ </span>
31
+ <span class="post-meta-date">
32
+ <time datetime="${post.date}" style="display: inline;"></time>
33
+ </span>
34
+ </div>
35
+ </div>
36
+ </div>`;
37
+ }
38
+
39
+ hexo.extend.tag.register('article', article)
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Chart.js tag for Solitude theme
3
+ */
4
+
5
+ 'use strict'
6
+
7
+ const chart = (args, content) => {
8
+ const id = Math.random().toString(36).substr(2, 9);
9
+ return `
10
+ <div class="chart">
11
+ <canvas id="chart-${id}"></canvas>
12
+ <script>
13
+ !function() {
14
+ const chart = () => {
15
+ const canvas = document.getElementById("chart-${id}");
16
+ if (!canvas) return;
17
+ const ctx = canvas.getContext("2d");
18
+ new Chart(ctx, {${content}});
19
+ };
20
+ document.addEventListener("DOMContentLoaded", chart);
21
+ utils.addEventListenerPjax(document, "pjax:complete", chart);
22
+ }()
23
+ </script>
24
+ </div>`;
25
+ }
26
+
27
+ hexo.extend.tag.register('chart', chart, {ends: true})
@@ -34,4 +34,4 @@ const gallery = (args, content) => {
34
34
  }
35
35
 
36
36
  hexo.extend.tag.register('gallery', gallery, {ends: true})
37
- hexo.extend.tag.register('galleryGroup', galleryBox)
37
+ hexo.extend.tag.register('galleryGroup', galleryBox)
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Typeit.js tag for Solitude theme
3
+ */
4
+
5
+ 'use strict'
6
+
7
+ const typeit = ([tag, options], content) => {
8
+ const id = Math.random().toString(36).substr(2, 9);
9
+ tag = tag || 'div';
10
+ return `
11
+ <div class="typeit">
12
+ <${tag} id="typeit-${id}"></${tag}>
13
+ <script>
14
+ !function() {
15
+ const typeit = () => {
16
+ const ctx = document.getElementById("typeit-${id}");
17
+ if (!ctx) return;
18
+ new TypeIt("#typeit-${id}", ${options})
19
+ .type("${content}")
20
+ .go();
21
+ }
22
+ document.addEventListener("DOMContentLoaded", typeit);
23
+ utils.addEventListenerPjax(document, "pjax:complete", typeit);
24
+ }()
25
+ </script>
26
+ </div>`
27
+ }
28
+
29
+ hexo.extend.tag.register('typeit', typeit, {ends: true})
@@ -89,4 +89,4 @@ minWidth2000()
89
89
  .limit-more-line
90
90
  display: -webkit-box
91
91
  overflow: hidden
92
- -webkit-box-orient: vertical
92
+ -webkit-box-orient: vertical
@@ -99,7 +99,7 @@
99
99
  line-height 2
100
100
  box-shadow var(--efu-shadow-border)
101
101
 
102
- img
102
+ img:not(.post_bg)
103
103
  border-radius 12px
104
104
  object-fit cover
105
105
  display block
@@ -215,4 +215,4 @@ if hexo-config('mediumZoom')
215
215
  z-index 10
216
216
 
217
217
  .medium-zoom-image--opened
218
- z-index 11
218
+ z-index 11
@@ -34,6 +34,7 @@
34
34
  transform translateY(20px)
35
35
  transition .3s
36
36
  max-width 1400px
37
+ min-width 1000px
37
38
 
38
39
  +maxWidth1300()
39
40
  justify-content center
@@ -69,8 +70,7 @@
69
70
  overflow hidden
70
71
 
71
72
  +maxWidth1300()
72
- width 100%
73
- margin 0
73
+ display none
74
74
 
75
75
  .console-card
76
76
  background var(--efu-maskbg)
@@ -79,6 +79,9 @@
79
79
  border var(--style-border)
80
80
  box-shadow var(--efu-shadow-border)
81
81
  padding 40px
82
+ gap 24px
83
+ display: flex
84
+ flex-direction: column
82
85
 
83
86
  .console-card.tags
84
87
  height calc(100% - 172px)
@@ -179,10 +182,10 @@
179
182
 
180
183
  .console-card.tags
181
184
  .card-tag-cloud
182
- margin-top 1.5rem
183
185
  display flex
184
186
  gap .5rem
185
187
  flex-wrap wrap
188
+ verflow-y: scroll
186
189
 
187
190
  a
188
191
  color var(--efu-fontcolor)
@@ -308,4 +311,4 @@
308
311
 
309
312
  #consoleHideAside
310
313
  +maxWidth768()
311
- display none
314
+ display none
@@ -8,18 +8,7 @@
8
8
  padding 0
9
9
 
10
10
  if hexo-config('index_post_list.direction') == "column"
11
- #recent-posts
12
- position relative
13
- +minWidth1300()
14
- display flex
15
- flex-wrap wrap
16
- gap .5rem
17
- transition width .3s
18
-
19
- +maxWidth768()
20
- padding 0 1rem
21
-
22
- > .recent-post-item
11
+ .recent-post-item
23
12
  box-shadow var(--efu-shadow-light2black)
24
13
  display flex
25
14
  align-items center
@@ -103,26 +92,18 @@ if hexo-config('index_post_list.direction') == "column"
103
92
  border-radius: 12px 12px 0 0
104
93
 
105
94
  > .recent-post-info
106
- height 174px
95
+ height 100%
107
96
  width 100%
97
+ padding 18px 32px 18px 32px
108
98
  cursor pointer
109
99
  position relative
110
- padding 0
111
- display inline-block
100
+ display flex
112
101
  overflow hidden
113
-
114
- .content
115
- -webkit-line-clamp 2
116
- display -webkit-box
117
- overflow hidden
118
- -webkit-box-orient vertical
119
- padding 5px 32px
120
- opacity .8
121
- font-size 14px
122
- line-height 1.8
123
-
124
- +maxWidth600()
125
- -webkit-line-clamp 1
102
+ flex-direction column
103
+ gap 16px
104
+ justify-content space-between
105
+ +minWidth1300()
106
+ min-height 165px
126
107
 
127
108
  span.tags-punctuation
128
109
  transition .3s
@@ -133,7 +114,6 @@ if hexo-config('index_post_list.direction') == "column"
133
114
  .recent-post-info-top
134
115
  position relative
135
116
  transition .3s
136
- padding 0 32px
137
117
  width 100%
138
118
 
139
119
  .article-title
@@ -148,10 +128,11 @@ if hexo-config('index_post_list.direction') == "column"
148
128
  display -webkit-box
149
129
  overflow hidden
150
130
  -webkit-box-orient vertical
131
+ +minWidth1300()
132
+ font-size 30px
151
133
 
152
134
  .recent-post-info-top-tips
153
135
  display flex
154
- margin-top 20px
155
136
  user-select none
156
137
 
157
138
  > .sticky-warp
@@ -183,8 +164,10 @@ if hexo-config('index_post_list.direction') == "column"
183
164
  color var(--efu-card-bg)
184
165
 
185
166
  /.article-meta-wrap
186
- position absolute
187
- bottom 16px
167
+ color var(--efu-fontcolor)
168
+ font-size .7rem
169
+ user-select none
170
+ position relative
188
171
  transition .3s
189
172
  display flex
190
173
  flex-direction row
@@ -192,10 +175,7 @@ if hexo-config('index_post_list.direction') == "column"
192
175
  justify-content space-between
193
176
  width 100%
194
177
  left 0
195
- padding 0 32px
196
178
  white-space nowrap
197
- color var(--efu-fontcolor)
198
- font-size .7rem
199
179
 
200
180
  > .article-meta
201
181
  margin 0 8px 0 0
@@ -230,6 +210,16 @@ if hexo-config('index_post_list.direction') == "column"
230
210
 
231
211
  .sticky
232
212
  color var(--efu-fontcolor)
213
+ #recent-posts
214
+ position relative
215
+ +minWidth1300()
216
+ display flex
217
+ flex-wrap wrap
218
+ gap .5rem
219
+ transition width .3s
220
+
221
+ +maxWidth768()
222
+ padding 0 1rem
233
223
 
234
224
  if hexo-config('index_post_list.direction') == "column" && hexo-config('index_post_list.column') == 2
235
225
  #recent-posts
@@ -249,23 +239,9 @@ if hexo-config('index_post_list.direction') == "column"
249
239
  flex 1 1 33.3%
250
240
  max-width 32.6%
251
241
  box-shadow var(--efu-shadow-border)
252
-
253
- else if hexo-config('index_post_list.direction') == "row"
254
- #recent-posts
255
- position relative
256
- display flex
257
- flex-wrap wrap
258
- justify-content space-between
259
- align-items flex-start
260
- align-content flex-start
261
- user-select none
262
- gap .5rem
263
- transition width .3s
264
242
 
265
- +maxWidth768()
266
- padding 0 1rem
267
-
268
- > .recent-post-item
243
+ else if hexo-config('index_post_list.direction') == "row"
244
+ .recent-post-item
269
245
  display flex
270
246
  align-items center
271
247
  animation slide-in .6s .4s backwards
@@ -340,30 +316,21 @@ else if hexo-config('index_post_list.direction') == "row"
340
316
  border-radius: 12px 12px 0 0
341
317
 
342
318
  > .recent-post-info
343
- height 174px
319
+ height 100%
344
320
  width 100%
321
+ padding 18px 32px 18px 32px
345
322
  cursor pointer
346
323
  position relative
347
- padding 0
348
- display inline-block
324
+ display flex
349
325
  overflow hidden
326
+ flex-direction column
327
+ gap 16px
328
+ justify-content space-between
329
+ +minWidth1300()
330
+ min-height 165px
350
331
  +maxWidth768()
351
332
  order 2
352
333
 
353
- .content
354
- -webkit-line-clamp 3
355
- display -webkit-box
356
- overflow hidden
357
- -webkit-box-orient vertical
358
- padding 5px 32px
359
- opacity .8
360
- font-size 14px
361
- line-height 1.8
362
- +maxWidth768()
363
- -webkit-line-clamp 2
364
- +maxWidth600()
365
- -webkit-line-clamp 1
366
-
367
334
  span.tags-punctuation
368
335
  transition .3s
369
336
 
@@ -373,7 +340,6 @@ else if hexo-config('index_post_list.direction') == "row"
373
340
  .recent-post-info-top
374
341
  position relative
375
342
  transition .3s
376
- padding 0 32px
377
343
  width 100%
378
344
 
379
345
  .article-title
@@ -425,8 +391,10 @@ else if hexo-config('index_post_list.direction') == "row"
425
391
  color var(--efu-card-bg)
426
392
 
427
393
  /.article-meta-wrap
428
- position absolute
429
- bottom 0
394
+ color var(--efu-fontcolor)
395
+ font-size .7rem
396
+ user-select none
397
+ position relative
430
398
  transition .3s
431
399
  display flex
432
400
  flex-direction row
@@ -434,10 +402,7 @@ else if hexo-config('index_post_list.direction') == "row"
434
402
  justify-content space-between
435
403
  width 100%
436
404
  left 0
437
- padding 0 32px
438
405
  white-space nowrap
439
- color var(--efu-fontcolor)
440
- font-size .7rem
441
406
  +maxWidth768()
442
407
  bottom 16px
443
408
 
@@ -473,4 +438,17 @@ else if hexo-config('index_post_list.direction') == "row"
473
438
  margin 0 .4rem 0 0
474
439
 
475
440
  .sticky
476
- color var(--efu-fontcolor)
441
+ color var(--efu-fontcolor)
442
+ #recent-posts
443
+ position relative
444
+ display flex
445
+ flex-wrap wrap
446
+ justify-content space-between
447
+ align-items flex-start
448
+ align-content flex-start
449
+ user-select none
450
+ gap .5rem
451
+ transition width .3s
452
+
453
+ +maxWidth768()
454
+ padding 0 1rem
@@ -22,12 +22,13 @@
22
22
  &::-webkit-scrollbar
23
23
  display none
24
24
 
25
- .recent-post-group
25
+ .top-post-group
26
26
  display flex
27
27
  flex-direction row
28
28
  justify-content start
29
29
  flex-wrap wrap
30
30
  align-content space-between
31
+ width 100%
31
32
  gap .5rem
32
33
 
33
34
  +maxWidth1200()
@@ -76,10 +77,10 @@
76
77
  position relative
77
78
  animation slide-in .6s .1s backwards
78
79
 
79
- .recent-post-item
80
+ .top-post-item
80
81
  display flex
81
82
  flex-direction column
82
- width calc(100% / 3 - 0.5rem)
83
+ flex 1 1 30%
83
84
  align-items flex-start
84
85
  background var(--efu-card-bg)
85
86
  border-radius 12px
@@ -92,15 +93,11 @@
92
93
  box-shadow var(--efu-shadow-border)
93
94
  min-width fit-content
94
95
 
95
- &:nth-last-child(2):nth-child(1),
96
- &:nth-last-child(1):nth-child(2)
97
- width calc(100% / 2 - 0.5rem)
98
-
99
96
  +maxWidth1200()
100
97
  width 200px
101
98
  min-width 200px
102
99
 
103
- &:hover .post_cover a .recent-post-top-text
100
+ &:hover .post_cover a .top-post-top-text
104
101
  left 0
105
102
 
106
103
  .post_cover
@@ -116,7 +113,7 @@
116
113
  width 100%
117
114
  background var(--efu-secondbg)
118
115
 
119
- .recent-post-top-text
116
+ .top-post-top-text
120
117
  position absolute
121
118
  top 0
122
119
  left -50px
@@ -132,7 +129,7 @@
132
129
  if $language == 'en-US'
133
130
  left -90px
134
131
 
135
- /.recent-post-info
132
+ /.top-post-info
136
133
  padding .3rem .5rem .3rem .5rem
137
134
  transition .3s
138
135
 
@@ -272,9 +269,7 @@
272
269
  color var(--efu-white)
273
270
  position relative
274
271
  background-size 200%
275
-
276
- &:not(:last-child)
277
- margin-right 10px
272
+ margin-right 10px
278
273
 
279
274
  &:hover
280
275
  background-position 100% 0
@@ -1,15 +1,13 @@
1
1
  div.console_recentcomments
2
2
  display flex
3
3
  flex-wrap wrap
4
- gap 12px
4
+ gap 8px
5
5
  min-height 100px
6
6
  width 100%
7
- margin-top .5rem
8
7
 
9
8
  .comment-card
10
9
  position relative
11
10
  width calc(100% / 3 - 8px)
12
- min-width fit-content
13
11
  background var(--efu-card-bg)
14
12
  border-radius 12px
15
13
  border var(--style-border-always)
@@ -114,7 +114,7 @@
114
114
  overflow hidden
115
115
  margin 0 -20% 0 auto
116
116
  transform rotate(10deg) translateY(-8%) scale(1.8)
117
- filter blur(10px)
117
+ filter blur(30px)
118
118
  opacity 0
119
119
 
120
120
  &.loaded
@@ -383,4 +383,4 @@
383
383
  background var(--efu-hovertext)
384
384
  border-radius 12px 12px 0 0
385
385
  +minWidth768()
386
- min-height 250px
386
+ min-height 250px
@@ -96,6 +96,7 @@
96
96
  display flex
97
97
  gap .5rem
98
98
  margin-top .5rem
99
+ flex-wrap wrap
99
100
 
100
101
  .gallery-item
101
102
  min-height 5rem
@@ -121,4 +122,4 @@
121
122
  opacity 0
122
123
  transition .3s
123
124
  &.show
124
- opacity 1
125
+ opacity 1
@@ -1,13 +1,13 @@
1
1
  error_img = hexo-config('errorpage.img')
2
2
 
3
3
  $dark_theme = convert(hexo-config('theme_color.dark'))
4
- $dark_theme_op = convert(hexo-config('theme_color.dark_op'))
5
- $dark_theme_op_deep = convert(hexo-config('theme_color.dark_op_deep'))
6
- $dark_theme_none = convert(hexo-config('theme_color.dark_none'))
4
+ $dark_theme_op = convert(hexo-config('theme_color.dark') + '23')
5
+ $dark_theme_op_deep = convert(hexo-config('theme_color.dark') + 'dd')
6
+ $dark_theme_none = convert(hexo-config('theme_color.dark') + '00')
7
7
  $light_theme = convert(hexo-config('theme_color.light'))
8
- $light_theme_op = convert(hexo-config('theme_color.light_op'))
9
- $light_theme_op_deep = convert(hexo-config('theme_color.light_op_deep'))
10
- $light_theme_none = hexo-config('theme_color.light_none')
8
+ $light_theme_op = convert(hexo-config('theme_color.light') + '23')
9
+ $light_theme_op_deep = convert(hexo-config('theme_color.light') + 'dd')
10
+ $light_theme_none = convert(hexo-config('theme_color.light') + '00')
11
11
 
12
12
  $todayCardColor = convert(hexo-config('hometop.recommendList.color'))
13
13
 
@@ -29,4 +29,4 @@ $line-height-code-block = 1.6
29
29
  $font-size = unquote(hexo-config('font.font-size'))
30
30
  $code-font-size = unquote(hexo-config('font.code-font-size'))
31
31
  $font-family = unquote(hexo-config('font.font-family'))
32
- $code-font-family = unquote(hexo-config('font.code-font-family'))
32
+ $code-font-family = unquote(hexo-config('font.code-font-family'))