hexo-theme-solitude 1.12.1 → 1.12.2
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 +3 -1
- package/README_en-US.md +2 -2
- package/README_zh-Hant.md +2 -2
- package/_config.yml +1 -0
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/page/about/other.pug +71 -70
- package/package.json +1 -1
- package/scripts/event/merge_config.js +1 -0
- package/scripts/tags/btns.js +35 -0
- package/source/css/_global/index.styl +1 -0
- package/source/css/_layout/recent-post.styl +19 -7
- package/source/css/_tags/btns.styl +212 -0
- package/source/css/third_party/tianli_talk.styl +16 -1
- package/source/js/main.js +1 -2
package/README.md
CHANGED
package/README_en-US.md
CHANGED
@@ -47,8 +47,8 @@
|
|
47
47
|
|
48
48
|
## Todo
|
49
49
|
|
50
|
-
- [x]
|
51
|
-
- [x]
|
50
|
+
- [x] The list of articles is displayed in three columns on the homepage.
|
51
|
+
- [x] btns tags plugin.
|
52
52
|
|
53
53
|
> If you have any questions, please issue an [issue](https://github.com/everfu/hexo-theme-solitude/issues)
|
54
54
|
|
package/README_zh-Hant.md
CHANGED
package/_config.yml
CHANGED
@@ -308,6 +308,7 @@ aside:
|
|
308
308
|
# Configure information on the home page
|
309
309
|
index_post_list:
|
310
310
|
direction: column # row / column
|
311
|
+
column: 2 #2:2列 3:3列
|
311
312
|
content: false # 1: post.description / 2: 自动获取description或截取内容(Automatically get descriptions or screenshots) / 3: 只使用截取内容(Use only screenshots) / false: 不显示内容(No content is displayed)
|
312
313
|
length: 500 # 截取内容的长度 : The length of the screenshot content
|
313
314
|
cover: both # left: 在左侧 : left / right: 在右侧 : right / both: 两侧 : both
|
@@ -28,7 +28,7 @@ include ../head/pwa.pug
|
|
28
28
|
|
29
29
|
script.
|
30
30
|
console.log(
|
31
|
-
"%c Program: Hexo %c Theme: Solitude %c Version: v1.12.
|
31
|
+
"%c Program: Hexo %c Theme: Solitude %c Version: v1.12.2",
|
32
32
|
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
|
33
33
|
"padding: 5px 10px;color:white;background:#3e9f50;",
|
34
34
|
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
|
@@ -1,82 +1,83 @@
|
|
1
1
|
- var tj = site.data.about.tj
|
2
2
|
- var oneself = site.data.about.oneself
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
.
|
8
|
-
.
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
.
|
20
|
-
|
21
|
-
|
22
|
-
|
4
|
+
if tj || oneself
|
5
|
+
.author-content
|
6
|
+
if tj
|
7
|
+
.about-statistic.author-content-item(style=`background: url(${tj.img});`)
|
8
|
+
.card-content
|
9
|
+
.author-content-item-tips=_p('about.other.tj.tip')
|
10
|
+
span.author-content-item-title=_p('about.other.tj.title')
|
11
|
+
#statistic
|
12
|
+
.post-tips
|
13
|
+
= _p('about.other.tj.post_tip')
|
14
|
+
case tj.provider
|
15
|
+
when '51la'
|
16
|
+
a(href="https://v6.51.la/") 51la网站统计
|
17
|
+
when 'baidu'
|
18
|
+
a(href="https://tongji.baidu.com/") 百度统计
|
19
|
+
if tj.button
|
20
|
+
.banner-button-group
|
21
|
+
a.banner-button(href=url_for(tj.button_link))
|
22
|
+
i.solitude.st-right-btn-fill
|
23
|
+
span.banner-button-text= tj.button_text
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
case tj.provider
|
26
|
+
when '51la'
|
27
|
+
script.
|
28
|
+
fetch("#{tj.url}")
|
29
|
+
.then(res => res.text())
|
30
|
+
.then(data => {
|
31
|
+
const title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
|
32
|
+
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
|
33
|
+
num = num.map(el => {
|
34
|
+
let val = el.replace(/(<\/span><span>)/g, "");
|
35
|
+
return val.replace(/(<\/span><\/p>)/g, "");
|
36
|
+
});
|
37
|
+
const s = document.getElementById("statistic");
|
38
|
+
let html = '';
|
39
|
+
for (let i = 0; i < num.length; i++) {
|
40
|
+
if (i === 0 || i === num.length - 1) continue;
|
41
|
+
html += `<div><span>${title[i]}</span><span id="${title[i]}">${num[i]}</span></div>`;
|
42
|
+
}
|
43
|
+
s.innerHTML = html;
|
35
44
|
});
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
s.innerHTML = html;
|
43
|
-
});
|
44
|
-
when 'baidu'
|
45
|
-
script.
|
46
|
-
fetch("#{tj.url}")
|
47
|
-
.then(res => res.json())
|
48
|
-
.then(data => {
|
49
|
-
const title = {"today_uv": "今日人数", "today_pv": "今日访问", "yesterday_uv": "昨日人数", "yesterday_pv": "昨日访问", "last_month_pv": "最近月访问", "last_year_pv": "最近年访问"};
|
45
|
+
when 'baidu'
|
46
|
+
script.
|
47
|
+
fetch("#{tj.url}")
|
48
|
+
.then(res => res.json())
|
49
|
+
.then(data => {
|
50
|
+
const title = {"today_uv": "今日人数", "today_pv": "今日访问", "yesterday_uv": "昨日人数", "yesterday_pv": "昨日访问", "last_month_pv": "最近月访问", "last_year_pv": "最近年访问"};
|
50
51
|
|
51
|
-
|
52
|
+
let s = document.getElementById("statistic");
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
for (let key in data) {
|
55
|
+
if (data.hasOwnProperty(key) && title[key]) {
|
56
|
+
s.innerHTML += `<div><span>${title[key]}</span><span id="${key}">${data[key]}</span></div>`;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
59
60
|
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
62
|
+
if oneself
|
63
|
+
style.
|
64
|
+
:root {
|
65
|
+
--site-about-oneself-map--light: url(#{oneself.map.light});
|
66
|
+
--site-about-oneself-map--dark: url(#{oneself.map.dark});
|
67
|
+
}
|
68
|
+
.author-content-item-group.column.mapAndInfo
|
69
|
+
.author-content-item.map.single
|
70
|
+
span.map-title=_p('about.other.oneself.map_title') + oneself.location
|
71
|
+
.author-content-item.selfInfo.single
|
72
|
+
div
|
73
|
+
span.selfInfo-title=_p('about.other.oneself.info_title1')
|
74
|
+
span.selfInfo-content(style="color: #43a6c6;")= oneself.birthYear
|
75
|
+
div
|
76
|
+
span.selfInfo-title= oneself.university
|
77
|
+
span.selfInfo-content(style="color: #c69043;")= oneself.major
|
78
|
+
div
|
79
|
+
span.selfInfo-title=_p('about.other.oneself.info_title2')
|
80
|
+
span.selfInfo-content(style="color: #b04fe6;")= oneself.occupation
|
80
81
|
|
81
82
|
- var cause = site.data.about.cause
|
82
83
|
|
package/package.json
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function postBtns(args, content) {
|
4
|
+
return `<div class="btns ${args.join(" ")}">
|
5
|
+
${content}
|
6
|
+
</div>`;
|
7
|
+
}
|
8
|
+
|
9
|
+
function postCell(args, content) {
|
10
|
+
args = args.join(" ").split(",");
|
11
|
+
let text = args[0] || "";
|
12
|
+
let url = args[1] || "";
|
13
|
+
text = text.trim();
|
14
|
+
url = url.trim();
|
15
|
+
if (url.length > 0) {
|
16
|
+
url = "href='" + url + "'";
|
17
|
+
}
|
18
|
+
let icon = "";
|
19
|
+
let img = "https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus/lib/assets/default.svg";
|
20
|
+
if (args.length > 2) {
|
21
|
+
if (args[2].indexOf(" solitude") > -1) {
|
22
|
+
icon = args[2].trim();
|
23
|
+
} else {
|
24
|
+
img = args[2].trim();
|
25
|
+
}
|
26
|
+
}
|
27
|
+
if (icon.length > 0) {
|
28
|
+
return `<a class="button no-text-decoration" ${url} title='${text}'><i class='${icon}'></i>${text}</a>`;
|
29
|
+
} else {
|
30
|
+
return `<a class="button no-text-decoration" ${url} title='${text}'><img src='${img}'>${text}</a>`;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
hexo.extend.tag.register("btns", postBtns, { ends: true });
|
35
|
+
hexo.extend.tag.register("cell", postCell);
|
@@ -32,13 +32,6 @@ if hexo-config('index_post_list.direction') == "column"
|
|
32
32
|
cursor pointer
|
33
33
|
border var(--style-border)
|
34
34
|
|
35
|
-
+minWidth1300()
|
36
|
-
flex-direction column
|
37
|
-
width 100%
|
38
|
-
flex 1 1 40%
|
39
|
-
max-width 50%
|
40
|
-
box-shadow var(--efu-shadow-border)
|
41
|
-
|
42
35
|
+maxWidth1300()
|
43
36
|
margin-bottom .5rem
|
44
37
|
|
@@ -238,6 +231,25 @@ if hexo-config('index_post_list.direction') == "column"
|
|
238
231
|
.sticky
|
239
232
|
color var(--efu-fontcolor)
|
240
233
|
|
234
|
+
if hexo-config('index_post_list.direction') == "column" && hexo-config('index_post_list.column') == 2
|
235
|
+
#recent-posts
|
236
|
+
> .recent-post-item
|
237
|
+
+minWidth1300()
|
238
|
+
flex-direction column
|
239
|
+
width 100%
|
240
|
+
flex 1 1 40%
|
241
|
+
max-width 50%
|
242
|
+
box-shadow var(--efu-shadow-border)
|
243
|
+
else if hexo-config('index_post_list.direction') == "column" && hexo-config('index_post_list.column') == 3
|
244
|
+
#recent-posts
|
245
|
+
> .recent-post-item
|
246
|
+
+minWidth1300()
|
247
|
+
flex-direction column
|
248
|
+
width 100%
|
249
|
+
flex 1 1 33.3%
|
250
|
+
max-width 32.6%
|
251
|
+
box-shadow var(--efu-shadow-border)
|
252
|
+
|
241
253
|
else if hexo-config('index_post_list.direction') == "row"
|
242
254
|
#recent-posts
|
243
255
|
position relative
|
@@ -0,0 +1,212 @@
|
|
1
|
+
[data-theme="dark"]
|
2
|
+
div
|
3
|
+
&.btns
|
4
|
+
filter brightness(0.7)
|
5
|
+
a
|
6
|
+
background 0 0
|
7
|
+
div
|
8
|
+
&.btns
|
9
|
+
margin 0 -8px
|
10
|
+
display flex
|
11
|
+
flex-wrap wrap
|
12
|
+
align-items flex-start
|
13
|
+
overflow visible
|
14
|
+
line-height 1.8
|
15
|
+
b
|
16
|
+
font-size 0.875rem
|
17
|
+
&.wide
|
18
|
+
& > a
|
19
|
+
padding-left 32px
|
20
|
+
padding-right 32px
|
21
|
+
&.fill
|
22
|
+
& > a
|
23
|
+
flex-grow 1
|
24
|
+
width auto
|
25
|
+
&.around
|
26
|
+
justify-content space-around
|
27
|
+
&.center
|
28
|
+
justify-content center
|
29
|
+
&.grid2
|
30
|
+
& > a
|
31
|
+
width calc(100% / 2 - 16px)
|
32
|
+
&.grid3
|
33
|
+
& > a
|
34
|
+
width calc(100% / 3 - 16px)
|
35
|
+
&.grid4
|
36
|
+
& > a
|
37
|
+
width calc(100% / 4 - 16px)
|
38
|
+
&.grid5
|
39
|
+
& > a
|
40
|
+
width calc(100% / 5 - 16px)
|
41
|
+
a
|
42
|
+
transition all 0.28s ease
|
43
|
+
-moz-transition all 0.28s ease
|
44
|
+
-webkit-transition all 0.28s ease
|
45
|
+
-o-transition all 0.28s ease
|
46
|
+
margin 8px
|
47
|
+
margin-top calc(1.25 * 16px + 32px)
|
48
|
+
min-width 120px
|
49
|
+
font-weight bold
|
50
|
+
display flex
|
51
|
+
justify-content flex-start
|
52
|
+
align-content center
|
53
|
+
align-items center
|
54
|
+
flex-direction column
|
55
|
+
padding 8px
|
56
|
+
text-align center
|
57
|
+
background #f6f6f6
|
58
|
+
border-radius 4px
|
59
|
+
border-bottom none!important
|
60
|
+
& > i
|
61
|
+
background #2196f3!important
|
62
|
+
&:first-child
|
63
|
+
color #fff
|
64
|
+
background #2196f3
|
65
|
+
b
|
66
|
+
font-weight bold
|
67
|
+
line-height 1.3
|
68
|
+
img
|
69
|
+
margin 0.4em auto !important
|
70
|
+
&:not([href])
|
71
|
+
cursor default
|
72
|
+
color inherit
|
73
|
+
a[href]:hover
|
74
|
+
background: var(--efu-main)
|
75
|
+
color: var(--efu-white) !important
|
76
|
+
& > i
|
77
|
+
&:first-child
|
78
|
+
background: var(--efu-main)
|
79
|
+
|
80
|
+
div.btns,
|
81
|
+
div.btns p,
|
82
|
+
div.btns a
|
83
|
+
font-size 0.8125rem
|
84
|
+
color #555
|
85
|
+
|
86
|
+
@media screen and (max-width: 1200px)
|
87
|
+
div
|
88
|
+
&.btns
|
89
|
+
&.grid2
|
90
|
+
& > a
|
91
|
+
width calc(100% / 2 - 16px)
|
92
|
+
|
93
|
+
@media screen and (max-width: 768px)
|
94
|
+
div
|
95
|
+
&.btns
|
96
|
+
&.grid2
|
97
|
+
& > a
|
98
|
+
width calc(100% / 2 - 16px)
|
99
|
+
|
100
|
+
@media screen and (max-width: 500px)
|
101
|
+
div
|
102
|
+
&.btns
|
103
|
+
&.grid2
|
104
|
+
& > a
|
105
|
+
width calc(100% / 1 - 16px)
|
106
|
+
|
107
|
+
@media screen and (max-width: 1200px)
|
108
|
+
div
|
109
|
+
&.btns
|
110
|
+
&.grid3
|
111
|
+
& > a
|
112
|
+
width calc(100% / 3 - 16px)
|
113
|
+
|
114
|
+
@media screen and (max-width: 768px)
|
115
|
+
div
|
116
|
+
&.btns
|
117
|
+
&.grid3
|
118
|
+
& > a
|
119
|
+
width calc(100% / 3 - 16px)
|
120
|
+
|
121
|
+
@media screen and (max-width: 500px)
|
122
|
+
div
|
123
|
+
&.btns
|
124
|
+
&.grid3
|
125
|
+
& > a
|
126
|
+
width calc(100% / 1 - 16px)
|
127
|
+
|
128
|
+
@media screen and (max-width: 1200px)
|
129
|
+
div
|
130
|
+
&.btns
|
131
|
+
&.grid4
|
132
|
+
& > a
|
133
|
+
width calc(100% / 3 - 16px)
|
134
|
+
|
135
|
+
@media screen and (max-width: 768px)
|
136
|
+
div
|
137
|
+
&.btns
|
138
|
+
&.grid4
|
139
|
+
& > a
|
140
|
+
width calc(100% / 3 - 16px)
|
141
|
+
|
142
|
+
@media screen and (max-width: 500px)
|
143
|
+
div
|
144
|
+
&.btns
|
145
|
+
&.grid4
|
146
|
+
& > a
|
147
|
+
width calc(100% / 2 - 16px)
|
148
|
+
|
149
|
+
@media screen and (max-width: 1200px)
|
150
|
+
div
|
151
|
+
&.btns
|
152
|
+
&.grid5
|
153
|
+
& > a
|
154
|
+
width calc(100% / 4 - 16px)
|
155
|
+
|
156
|
+
@media screen and (max-width: 768px)
|
157
|
+
div
|
158
|
+
&.btns
|
159
|
+
&.grid5
|
160
|
+
& > a
|
161
|
+
width calc(100% / 3 - 16px)
|
162
|
+
|
163
|
+
@media screen and (max-width: 500px)
|
164
|
+
div
|
165
|
+
&.btns
|
166
|
+
&.grid5
|
167
|
+
& > a
|
168
|
+
width calc(100% / 2 - 16px)
|
169
|
+
|
170
|
+
div.btns a > img:first-child,
|
171
|
+
div.btns a > i:first-child
|
172
|
+
transition all 0.28s ease
|
173
|
+
-moz-transition all 0.28s ease
|
174
|
+
-webkit-transition all 0.28s ease
|
175
|
+
-o-transition all 0.28s ease
|
176
|
+
height 64px
|
177
|
+
width 64px
|
178
|
+
box-shadow 0 1px 2px 0 rgba(0, 0, 0, 0.1)
|
179
|
+
margin 16px 8px 4px 8px
|
180
|
+
margin-top calc(-1.25 * 16px - 32px)
|
181
|
+
border 2px solid #fff
|
182
|
+
background #fff
|
183
|
+
line-height 60px
|
184
|
+
font-size 28px
|
185
|
+
|
186
|
+
div.btns a > img:first-child.auto,
|
187
|
+
div.btns a > i:first-child.auto
|
188
|
+
width auto
|
189
|
+
|
190
|
+
div.btns a p,
|
191
|
+
div.btns a b
|
192
|
+
margin 0.25em
|
193
|
+
font-weight normal
|
194
|
+
line-height 1.25
|
195
|
+
word-wrap break-word
|
196
|
+
|
197
|
+
div.btns a[href]:hover,
|
198
|
+
div.btns a[href]:hover b
|
199
|
+
color #ff5722
|
200
|
+
|
201
|
+
div.btns a[href]:hover > img:first-child,
|
202
|
+
div.btns a[href]:hover > i:first-child
|
203
|
+
transform scale(1.1) translateY(-8px)
|
204
|
+
box-shadow 0 4px 8px 0 rgba(0, 0, 0, 0.1)
|
205
|
+
|
206
|
+
div.btns.circle a > img:first-child,
|
207
|
+
div.btns.circle a > i:first-child
|
208
|
+
border-radius 32px
|
209
|
+
|
210
|
+
div.btns.rounded a > img:first-child,
|
211
|
+
div.btns.rounded a > i:first-child
|
212
|
+
border-radius 16px
|
@@ -32,6 +32,12 @@
|
|
32
32
|
opacity 0
|
33
33
|
transition .3s
|
34
34
|
|
35
|
+
#post_chat_button
|
36
|
+
display none
|
37
|
+
|
38
|
+
+maxWidth768()
|
39
|
+
display block
|
40
|
+
|
35
41
|
#postChat_iframeContainer
|
36
42
|
z-index 1000
|
37
43
|
border var(--style-border-always)
|
@@ -39,12 +45,21 @@
|
|
39
45
|
animation to_show_fromLeftBottom .2s ease-out
|
40
46
|
border-radius 12px
|
41
47
|
|
48
|
+
+maxWidth768()
|
49
|
+
width 100% !important
|
50
|
+
height 100% !important
|
51
|
+
bottom 0 !important
|
52
|
+
left 0 !important
|
53
|
+
max-width 100% !important
|
54
|
+
max-height 100% !important
|
55
|
+
border-radius 0 !important
|
56
|
+
|
42
57
|
#efuTalk.on span.efuTalkTitle, #efuTalk:hover span.efuTalkTitle
|
43
58
|
color var(--efu-card-bg)
|
44
59
|
opacity 1
|
45
60
|
|
46
61
|
#postChat_button
|
47
|
-
display none!important
|
62
|
+
display none !important
|
48
63
|
|
49
64
|
#efuTalk i.solitude.efuTalkIcon
|
50
65
|
width 18px
|
package/source/js/main.js
CHANGED
@@ -28,7 +28,6 @@ const sidebarFn = () => {
|
|
28
28
|
}
|
29
29
|
const scrollFn = () => {
|
30
30
|
const innerHeight = window.innerHeight;
|
31
|
-
if (document.body.scrollHeight <= innerHeight) return;
|
32
31
|
let initTop = 0;
|
33
32
|
const $header = document.getElementById('page-header');
|
34
33
|
const throttledScroll = utils.throttle((e) => {
|
@@ -375,7 +374,7 @@ const sco = {
|
|
375
374
|
}
|
376
375
|
pageText.addEventListener("keydown", (event) => {
|
377
376
|
if (event.keyCode === 13) {
|
378
|
-
|
377
|
+
sco.toPage();
|
379
378
|
pjax.loadUrl(pageButton.href);
|
380
379
|
}
|
381
380
|
});
|