hexo-theme-solitude 2.1.12 → 2.1.13

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/_config.yml CHANGED
@@ -93,6 +93,7 @@ hometop:
93
93
  group:
94
94
  # 热门: /tags/Fire/ || fas fa-fire || linear-gradient(to right,#f65,#ffbf37)
95
95
  recommendList:
96
+ enable: true
96
97
  sup: 置顶
97
98
  title: Solitude 官方文档
98
99
  url: https://solitude.js.org/
@@ -5,8 +5,9 @@
5
5
  .aside-list
6
6
  each post in site.posts.data.sort((a, b) => b.date < a.date ? -1 : 1).slice(0, 5)
7
7
  a.aside-list-item(href=url_for(post.path) title=post.title)
8
- .thumbnail
9
- img(alt=post.title src=url_for(post.cover))
8
+ if post.cover
9
+ .thumbnail
10
+ img(alt=post.title src=url_for(post.cover))
10
11
  .content
11
12
  span.title(href=url_for(post.path) title=post.title)= post.title
12
13
  if post.categories.data[0]
@@ -23,4 +23,7 @@ if icon
23
23
  .tags-group-icon-pair
24
24
  each key in pair
25
25
  .tags-group-icon(style=`background: ${icon[key].color}`)
26
- img.nolazyload(src=icon[key].img, title=key)
26
+ if icon[key].img
27
+ img.nolazyload(src=icon[key].img, title=key)
28
+ else if icon[key].icon
29
+ i(class=icon[key].icon, style=`color: ${icon[key].icon_color ? icon[key].icon_color : ''}`)
@@ -3,5 +3,6 @@
3
3
  #bannerGroup
4
4
  #banners
5
5
  include ./banner.pug
6
- .topGroup
7
- include ./topGroup.pug
6
+ if theme.hometop.recommendList.enable
7
+ .topGroup
8
+ include ./topGroup.pug
@@ -44,15 +44,17 @@ div.recent-post-item(onclick="pjax.loadUrl('" + url_for(post.path) + "')")
44
44
  else
45
45
  case position
46
46
  when 0
47
- div.post_cover
48
- +cover()
47
+ if post.cover
48
+ div.post_cover
49
+ +cover()
49
50
  div.recent-post-info
50
51
  +info()
51
52
  when 1
52
53
  div.recent-post-info
53
54
  +info()
54
- div.post_cover
55
- +cover()
55
+ if post.cover
56
+ div.post_cover
57
+ +cover()
56
58
 
57
59
 
58
60
  if theme.google_adsense && theme.google_adsense.enable && theme.google_adsense.auto_ads === false && theme.google_adsense.post_card
@@ -11,21 +11,27 @@ if skills || careers
11
11
  .skills-style-group
12
12
  .tags-group-all
13
13
  .tags-group-wrapper
14
- each i in [1,2]
15
- - var pair = []
16
- each tag, index in skills.tags
17
- - pair.push(tag)
18
- if pair.length === 2 || index === skills.tags.length - 1
19
- .tags-group-icon-pair
20
- each item in pair
21
- .tags-group-icon(style=`background:${item.color}`)
22
- img(src=item.icon, title=item.title)
23
- - pair = []
14
+ - var pair = []
15
+ each tag, index in skills.tags
16
+ - pair.push(tag)
17
+ if pair.length === 2 || index === skills.tags.length - 1
18
+ .tags-group-icon-pair
19
+ each item in pair
20
+ .tags-group-icon(style=`background:${item.color}`)
21
+ if item.img
22
+ img(src=item.img, title=item.title)
23
+ else if item.icon
24
+ i(class=item.icon, title=item.title, style=`color: ${item.icon_color ? item.icon_color : ''}`)
25
+ - pair = []
24
26
  .skills-list
25
27
  each tag in skills.tags
26
28
  .skill-info
27
29
  .skill-icon(style=`background:${tag.color}`)
28
- img(src=tag.icon, title=tag.title)
30
+ if tag.img
31
+ img(src=tag.img, title=tag.title)
32
+ else if tag.icon
33
+ i(class=tag.icon, title=tag.title, style=`color: ${tag.icon_color ? tag.icon_color : ''}`)
34
+
29
35
  .skill-name
30
36
  span= tag.title
31
37
  .etc ...
@@ -2,7 +2,7 @@
2
2
  .post-copyright
3
3
  .post-copyright__author_group
4
4
  a.post-copyright__author_img(href=url_for(copyright.author.url))
5
- img.post-copyright__author_img_front(src=page.avatar || copyright.author.img || theme.site.icon)
5
+ img.post-copyright__author_img_front(src=url_for(page.avatar || copyright.author.img || theme.site.icon))
6
6
  .post-copyright__author_name= page.author || config.title
7
7
  .post-copyright__author_desc= page.desc || config.subtitle
8
8
  .post-tools#post-tools
@@ -1,4 +1,4 @@
1
- #post-info
1
+ #post-info(style=`${page.top_color ? 'background: ' + page.top_color : ''}`)
2
2
  #post-firstinfo
3
3
  .meta-firstline
4
4
  - var cc = page.reprint ? _p('post.reprint') : _p('post.original')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -3,13 +3,14 @@
3
3
  hexo.extend.filter.register('after_post_render', function (data) {
4
4
  data.title = data.title || 'Untitled';
5
5
  const { config } = hexo.theme;
6
- const defaultCover = ['/img/default.avif'];
7
6
 
8
7
  const setCoverAndExcerpt = (layout) => {
9
8
  const { copyright, locate, cover } = hexo.theme.config[layout].default;
10
9
  data.locate = data.locate || locate;
11
10
  data.cc = data.cc || copyright;
12
- data.cover = data.cover || (cover?.length ? cover[getRandomInt(0, cover.length)] : defaultCover[0]);
11
+ data.cover = data.cover || (cover?.length && cover[getRandomInt(0, cover.length)]);
12
+ data.top_color = data.top_color;
13
+ data.not_cover = data.cover ? false : true;
13
14
  data.excerpt = layout === 'post' ? data.description || data.excerpt : data.title;
14
15
  data.toc = !!(config.aside.toc[layout] && data.toc !== false);
15
16
  data.aside = layout === 'post' ? (data.aside || true) : (data.aside || false);
@@ -723,7 +723,7 @@ if hexo-config('aside.card.style') == 2
723
723
  .avatar-img
724
724
  overflow hidden
725
725
  border-radius 500px
726
- width 74px
726
+ width 75px
727
727
  cursor pointer
728
728
  height 74px
729
729
 
@@ -255,8 +255,6 @@ else if hexo-config('index_post_list.direction') == "row"
255
255
  flex-direction row
256
256
  width 100%
257
257
  box-shadow var(--efu-shadow-border)
258
- #tag &:first-child
259
- margin-top: 2.5rem
260
258
 
261
259
  +maxWidth768()
262
260
  border-radius 12px
@@ -37,7 +37,7 @@
37
37
  / #bannerGroup
38
38
  display flex
39
39
  +minWidth1201()
40
- width calc(50% - .25rem)
40
+ flex 1 1 0
41
41
  height calc(328px + .5rem)
42
42
  display flex
43
43
  flex-direction column
@@ -70,10 +70,10 @@
70
70
  display flex
71
71
  flex-direction row
72
72
  flex-wrap wrap
73
+ flex 1 1 0
73
74
  justify-content flex-start
74
75
  height calc(328px + 0.5rem)
75
76
  align-content space-between
76
- width calc(50% - 0.25rem)
77
77
  position relative
78
78
  animation slide-in .6s .1s backwards
79
79
 
@@ -63,13 +63,13 @@
63
63
  width 100%
64
64
  padding-bottom 2rem
65
65
 
66
- .error_title
67
- font-size 4rem
68
-
69
66
  .error_title
70
67
  font-size 9em
71
68
  line-height 1
72
69
 
70
+ +maxWidth768()
71
+ font-size 4rem
72
+
73
73
  .error_subtitle
74
74
  word-break break-word
75
75
  font-size 1.6em
@@ -81,12 +81,12 @@
81
81
  padding .3rem 1.5rem
82
82
  background var(--btn-bg)
83
83
  color var(--btn-color)
84
- transition .3s
85
84
 
86
85
  &:hover
87
86
  background var(--efu-theme)
88
87
 
89
88
  i
89
+ font-size 16px
90
90
  padding-right .3rem
91
91
 
92
92
  .aside-list
@@ -98,10 +98,7 @@
98
98
 
99
99
  +maxWidth768()
100
100
  padding-top 0
101
-
102
- .aside-list-item
103
- .thumbnail
104
- height 100px
101
+ margin 0
105
102
 
106
103
  .aside-list-group
107
104
  display flex
@@ -127,6 +124,9 @@
127
124
  background var(--efu-card-bg)
128
125
  display flex
129
126
 
127
+ +maxWidth768()
128
+ height 100px
129
+
130
130
  .content .title
131
131
  -webkit-line-clamp 2
132
132
  overflow hidden
@@ -186,7 +186,6 @@
186
186
  z-index 1
187
187
 
188
188
  +minWidth1300()
189
- width 1100px
190
189
  font-size 2.6rem !important
191
190
 
192
191
  #post-meta