hexo-theme-solitude 1.7.5 → 1.7.7

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
@@ -138,6 +138,12 @@ hometop:
138
138
  # Shadow color
139
139
  color: "none"
140
140
 
141
+ ## banner
142
+ ## 推荐文章banner
143
+ # 使用方法:在文章的front matter中添加“recommend: true”
144
+ # tip:建议开了这个就不要开hometop,其功能类似
145
+ banner: false
146
+
141
147
  # --------------------------------------
142
148
  # Aside Settings
143
149
  # 侧边栏配置
@@ -164,7 +170,7 @@ aside:
164
170
  page:
165
171
  noSticky: "about"
166
172
  Sticky: "newestPost,allInfo"
167
- position: 0 # left(0): 左侧 / right(1): 右侧
173
+ position: 1 # left(0): 左侧 / right(1): 右侧
168
174
  # 侧边栏个人信息卡片
169
175
  # Sidebar personal information
170
176
  card:
package/languages/en.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  more: More
2
2
  star: Behold, those who found delight in this piece also perused
3
3
  random: Around
4
+ upload: 'datetime: '
4
5
 
5
6
  theme:
6
7
  dark: dark
@@ -1,6 +1,7 @@
1
1
  more: 更多
2
2
  star: 喜欢这篇的人也看了
3
3
  random: 随便逛逛
4
+ upload: 发布时间:
4
5
 
5
6
  # Language: 简体中文
6
7
  theme:
@@ -1,6 +1,7 @@
1
1
  more: 更多
2
2
  star: 喜歡這篇的人也看了
3
3
  random: 随便逛逛
4
+ upload: 發佈時間:
4
5
 
5
6
  # Language: 繁體中文 (台灣)
6
7
  theme:
@@ -109,6 +109,9 @@ div#js-pjax
109
109
  if is_home() && theme.says.home_mini
110
110
  script.
111
111
  sco.initbbtalk();
112
+ if is_home() && theme.banner && site.posts.data.filter(item => item.recommend === true).slice(0,6) || false
113
+ script.
114
+ banner_swiper()
112
115
  if page.type === 'says' && theme.says.enable
113
116
  script.
114
117
  window.addEventListener('resize', utils.throttle(function () {
@@ -118,6 +121,7 @@ div#js-pjax
118
121
  }), 500);
119
122
  sco.reflashEssayWaterFall();
120
123
  GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
124
+ sco.changeTimeFormat(document.querySelectorAll('.bber-info-time time'))
121
125
  if theme.busuanzi && (theme.aside.siteinfo.uv || theme.aside.siteinfo.pv)
122
126
  script(async src=url_for(theme.cdn.busuanzi_js))
123
127
 
@@ -111,7 +111,7 @@ script.
111
111
  )(window)
112
112
 
113
113
  console.log(
114
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.5",
114
+ "%c Program: Hexo %c Theme: Solitude %c Version: v1.7.7",
115
115
  "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
116
116
  "padding: 5px 10px;color:white;background:#3e9f50;",
117
117
  "border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
@@ -0,0 +1,49 @@
1
+ - let recommends = site.posts.data.filter(item => item.recommend === true).slice(0,6) || false
2
+
3
+ if recommends
4
+ .recent-post-item#swiperBox
5
+ span.swiperBox-top-text= _p('home.recommend')
6
+ div.blog-slider.swiper-container-fade.swiper-container-horizontal#swiper_container
7
+ .blog-slider__wrp.swiper-wrapper
8
+ each item,index in recommends
9
+ .blog-slider__item.swiper-slide(style=`background-image: url(${item.cover})`)
10
+ .blog-slider__content
11
+ a.blog-slider__title(onclick=`event.stopPropagation();`, href=item.path)=item.title
12
+ span.blog-slider__code
13
+ =_p('upload')
14
+ time(datetime=item.date)
15
+ .blog-slider__text=item.description
16
+ .swiper-button-next
17
+ .swiper-button-prev
18
+ .blog-slider__pagination.swiper-pagination-clickable.swiper-pagination-bullets
19
+
20
+ script.
21
+ function banner_swiper() {
22
+ let e = new Swiper(".blog-slider", {
23
+ navigation: {
24
+ nextEl: ".swiper-button-next",
25
+ prevEl: ".swiper-button-prev"
26
+ },
27
+ passiveListeners: !0,
28
+ loop: !0,
29
+ autoplay: {
30
+ disableOnInteraction: !0,
31
+ delay: 5e3
32
+ },
33
+ mousewheel: !0,
34
+ pagination: {
35
+ el: ".blog-slider__pagination",
36
+ clickable: !0
37
+ }
38
+ })
39
+ , t = document.getElementById("swiper_container");
40
+ null !== t && (t.onmouseenter = () => {
41
+ e.autoplay.stop()
42
+ }
43
+ ,
44
+ t.onmouseleave = () => {
45
+ e.autoplay.start()
46
+ }
47
+ )
48
+ }
49
+
package/layout/index.pug CHANGED
@@ -9,6 +9,8 @@ block content
9
9
  include ./includes/widgets/home/hometop
10
10
  main.layout#content-inner
11
11
  .recent-posts#recent-posts
12
+ if theme.banner && is_home_first_page()
13
+ include ./includes/widgets/home/leonus.pug
12
14
  #category-bar
13
15
  include ./includes/widgets/home/categoryBar
14
16
  for post, index in page.posts.sort("-sticky" || "-date").data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-solitude",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
4
4
  "description": "A beautiful, powerful, and efficient Hexo theme developed by the efu.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -9,7 +9,10 @@
9
9
  margin-top: 0
10
10
 
11
11
  +minWidth900()
12
- padding-left 15px
12
+ if hexo-config('aside.position') == 0
13
+ padding-right 15px
14
+ else
15
+ padding-left 15px
13
16
 
14
17
  +maxWidth1200()
15
18
  display none
@@ -0,0 +1,116 @@
1
+ div#swiper_container
2
+ width 100%
3
+ height 12rem
4
+ position relative
5
+ transition all .3s
6
+ overflow hidden
7
+
8
+ #swiperBox
9
+ margin-top 0!important
10
+ cursor default
11
+
12
+ .swiperBox-top-text
13
+ position absolute
14
+ z-index 2
15
+ color var(--efu-white)
16
+ background var(--efu-red)
17
+ letter-spacing 3px
18
+ top 0
19
+ left 15px
20
+ font-size 15px
21
+ width 35px
22
+ display flex
23
+ justify-content center
24
+ border-radius 0 0 12px 12px
25
+
26
+ .swiper-button-next::after, .swiper-button-prev::after
27
+ font-size 1rem !important
28
+
29
+ .swiper-button-prev, .swiper-button-next
30
+ transition all .3s
31
+ color var(--efu-main) !important
32
+
33
+ &:hover
34
+ transition all .3s
35
+ border-radius 5px
36
+ color var(--efu-card-bg) !important
37
+ background var(--efu-maskbg)
38
+
39
+ .swiper-button-next::after, .swiper-button-prev::after
40
+ font-size 1.5rem
41
+ color var(--efu-bg)
42
+
43
+ .blog-slider__pagination .swiper-pagination-bullet
44
+ margin 0 8px
45
+ width 11px
46
+ height 11px
47
+ display inline-block
48
+ border-radius 99px
49
+ background var(--efu-white)
50
+ opacity .8
51
+ transition all .3s
52
+
53
+ .blog-slider__pagination .swiper-pagination-bullet-active
54
+ opacity 1
55
+ background var(--efu-main)
56
+ width 30px
57
+
58
+ .blog-slider__pagination
59
+ position absolute
60
+ z-index 21
61
+ text-align center
62
+
63
+ #recent-posts > #swiperBox.recent-post-item
64
+ cursor default
65
+
66
+ .blog-slider__item
67
+ background-size cover
68
+ background-position center
69
+ overflow hidden
70
+
71
+ &::after
72
+ content ''
73
+ position absolute
74
+ width 100%
75
+ height 100%
76
+ background-color rgba(0, 0, 0, .5)
77
+ z-index -1
78
+ left 0
79
+ top 0
80
+
81
+ .blog-slider__content > *
82
+ text-align center
83
+ line-height 1.5
84
+ margin 2px 0
85
+ color var(--efu-white)
86
+
87
+ a.blog-slider__title
88
+ font-size 2rem
89
+
90
+ +maxWidth768()
91
+ font-size 1.3rem
92
+
93
+ .blog-slider__code
94
+ display block
95
+ font-weight 500
96
+
97
+ .blog-slider__text
98
+ font-size 18px
99
+ -webkit-line-clamp 2
100
+ overflow hidden
101
+ display -webkit-box
102
+ -webkit-box-orient vertical
103
+ +minWidth1300()
104
+ padding 0 5rem
105
+ +maxWidth900()
106
+ padding 0 3rem
107
+ +maxWidth768()
108
+ display none
109
+
110
+ .blog-slider__content
111
+ padding 0 50px 20px
112
+ display flex
113
+ justify-content center
114
+ align-items center
115
+ flex-direction column
116
+ height 100%
@@ -11,6 +11,9 @@ if hexo-config('hometop.enable') || hexo-config('says.enable')
11
11
  if hexo-config('hometop.enable')
12
12
  @import "home-top.styl"
13
13
 
14
+ if hexo-config('banner')
15
+ @import "banner.styl"
16
+
14
17
  @import "category-bar.styl"
15
18
 
16
19
  @import "recent-post.styl"
@@ -5,7 +5,6 @@ if hexo-config('says.home_mini')
5
5
  display flex
6
6
  white-space nowrap
7
7
  overflow hidden
8
- margin-bottom 1rem
9
8
  border var(--style-border)
10
9
  transition .3s
11
10
  height 50px
@@ -18,12 +17,17 @@ if hexo-config('says.home_mini')
18
17
  &.more-page
19
18
  margin-bottom 0
20
19
 
21
- +maxWidth1300()
20
+ if hexo-config('hometop.enable')
22
21
  margin-bottom 1rem
22
+
23
+ +maxWidth1300()
24
+ if hexo-config('hometop.enable')
25
+ margin-bottom 1rem
23
26
  animation slide-in .6s 0s backwards
24
27
 
25
28
  +minWidth1300()
26
- margin-bottom .5rem
29
+ if hexo-config('hometop.enable')
30
+ margin-bottom .5rem
27
31
  animation slide-in .6s 0s backwards
28
32
  &:hover
29
33
  border var(--style-border-hover)