hexo-theme-solitude 3.0.10 → 3.0.12
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 +45 -57
- package/languages/default.yml +14 -15
- package/languages/en.yml +22 -24
- package/languages/zh-CN.yml +14 -15
- package/languages/zh-TW.yml +14 -15
- package/layout/includes/head/config.pug +0 -11
- package/layout/includes/head/page_config.pug +1 -1
- package/layout/includes/inject/body.pug +1 -1
- package/layout/includes/layout.pug +0 -4
- package/layout/includes/page/brevity.pug +2 -2
- package/layout/includes/widgets/page/about/award.pug +1 -1
- package/layout/includes/widgets/page/about/skillsinfo.pug +12 -11
- package/layout/includes/widgets/page/kit/content.pug +3 -2
- package/layout/includes/widgets/page/links/banner.pug +7 -6
- package/layout/includes/widgets/post/ai.pug +7 -0
- package/layout/includes/widgets/sidebar/artalk.pug +1 -1
- package/layout/post.pug +2 -2
- package/package.json +6 -6
- package/plugins.yml +8 -8
- package/scripts/event/cdn.js +83 -60
- package/scripts/event/merge_config.js +385 -385
- package/scripts/filter/default.js +22 -24
- package/scripts/tags/tabs.js +29 -18
- package/source/css/_global/index.styl +2 -2
- package/source/css/_layout/article-container.styl +1 -1
- package/source/css/_layout/other.styl +2 -2
- package/source/css/_page/_about/reward.styl +13 -12
- package/source/css/_post/index.styl +103 -4
- package/source/css/_tags/gallery.styl +1 -0
- package/source/css/_tags/tabs.styl +36 -96
- package/source/css/index.styl +0 -4
- package/source/js/main.js +447 -257
- package/source/js/post_ai.js +118 -0
- package/source/js/utils.js +0 -6
- package/layout/includes/widgets/post/post-ai.pug +0 -12
- package/layout/includes/widgets/third-party/tianli-talk.pug +0 -26
- package/source/css/_post/postAI.styl +0 -132
- package/source/css/third_party/tianli_talk.styl +0 -77
- package/source/js/third_party/post_ai.min.js +0 -184
@@ -1,32 +1,30 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
hexo.extend.filter.register(
|
4
|
-
|
5
|
-
|
3
|
+
hexo.extend.filter.register("after_post_render", function (data) {
|
4
|
+
data.title = data.title || "Untitled";
|
5
|
+
const { config } = hexo.theme;
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
const setCoverAndExcerpt = (layout) => {
|
8
|
+
const { copyright, locate, cover } = hexo.theme.config[layout].default;
|
9
|
+
data.locate = data.locate || locate;
|
10
|
+
data.cc = data.cc || copyright;
|
11
|
+
data.cover =
|
12
|
+
data.cover || (cover?.length && cover[getRandomInt(0, cover.length)]);
|
13
|
+
data.not_cover = data.cover ? false : true;
|
14
|
+
data.excerpt =
|
15
|
+
layout === "post" ? data.description || data.excerpt : data.title;
|
16
|
+
data.toc = !!(config.aside.toc[layout] && data.toc !== false);
|
17
|
+
data.aside = layout === "post" ? data.aside || true : data.aside || false;
|
18
|
+
};
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
if (data.layout === "post" || data.layout === "page") {
|
21
|
+
setCoverAndExcerpt(data.layout);
|
22
|
+
}
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
data.comment = !!(config.comment.use && data.comment !== false);
|
27
|
-
return data;
|
24
|
+
data.comment = !!(config.comment.use && data.comment !== false);
|
25
|
+
return data;
|
28
26
|
});
|
29
27
|
|
30
28
|
function getRandomInt(min, max) {
|
31
|
-
|
29
|
+
return Math.floor(Math.random() * (max - min)) + Math.ceil(min);
|
32
30
|
}
|
package/scripts/tags/tabs.js
CHANGED
@@ -3,27 +3,32 @@
|
|
3
3
|
* from solitude
|
4
4
|
*/
|
5
5
|
|
6
|
-
|
6
|
+
"use strict";
|
7
7
|
|
8
8
|
function postTabs([name, active], content) {
|
9
9
|
const tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
|
10
10
|
const matches = [...content.matchAll(tabBlock)];
|
11
|
-
|
11
|
+
|
12
12
|
active = Number(active) || 0;
|
13
13
|
|
14
14
|
const generateTabItems = (matches, name, active) => {
|
15
15
|
return matches.map((match, tabId) => {
|
16
|
-
const [tabCaption =
|
17
|
-
const postContent = hexo.render
|
18
|
-
|
19
|
-
|
20
|
-
const
|
21
|
-
|
22
|
-
const
|
23
|
-
|
16
|
+
const [tabCaption = "", tabIcon = ""] = match[1].split("@");
|
17
|
+
const postContent = hexo.render
|
18
|
+
.renderSync({ text: match[2], engine: "markdown" })
|
19
|
+
.trim();
|
20
|
+
const tabHref = `${name.toLowerCase().replace(/\s+/g, "-")}-${tabId}`;
|
21
|
+
|
22
|
+
const iconHtml = tabIcon
|
23
|
+
? `<i class="${tabIcon.trim()} tab solitude"></i>`
|
24
|
+
: "";
|
25
|
+
const isActive = active === tabId ? " active" : "";
|
26
|
+
|
24
27
|
return {
|
25
|
-
nav: `<li class="tab${isActive}"><button type="button" data-href="#${tabHref}">${iconHtml}${
|
26
|
-
|
28
|
+
nav: `<li class="tab${isActive}"><button type="button" data-href="#${tabHref}">${iconHtml}${
|
29
|
+
tabCaption.trim() || `${name} ${tabId}`
|
30
|
+
}</button></li>`,
|
31
|
+
content: `<div class="tab-item-content${isActive}" id="${tabHref}">${postContent}</div>`,
|
27
32
|
};
|
28
33
|
});
|
29
34
|
};
|
@@ -31,16 +36,22 @@ function postTabs([name, active], content) {
|
|
31
36
|
const tabItems = generateTabItems(matches, name, active);
|
32
37
|
|
33
38
|
const createTabStructure = (tabItems) => {
|
34
|
-
const tabNav = `<ul class="nav-tabs">${tabItems
|
35
|
-
|
39
|
+
const tabNav = `<ul class="nav-tabs">${tabItems
|
40
|
+
.map((item) => item.nav)
|
41
|
+
.join("")}</ul>`;
|
42
|
+
const tabContent = `<div class="tab-contents">${tabItems
|
43
|
+
.map((item) => item.content)
|
44
|
+
.join("")}</div>`;
|
36
45
|
return { tabNav, tabContent };
|
37
46
|
};
|
38
47
|
|
39
48
|
const { tabNav, tabContent } = createTabStructure(tabItems);
|
40
49
|
|
41
|
-
return `<div class="tabs" id="${name
|
50
|
+
return `<div class="tabs" id="${name
|
51
|
+
.toLowerCase()
|
52
|
+
.replace(/\s+/g, "-")}">${tabNav}${tabContent}</div>`;
|
42
53
|
}
|
43
54
|
|
44
|
-
hexo.extend.tag.register(
|
45
|
-
hexo.extend.tag.register(
|
46
|
-
hexo.extend.tag.register(
|
55
|
+
hexo.extend.tag.register("tabs", postTabs, { ends: true });
|
56
|
+
hexo.extend.tag.register("subtabs", postTabs, { ends: true });
|
57
|
+
hexo.extend.tag.register("subsubtabs", postTabs, { ends: true });
|
@@ -56,7 +56,7 @@
|
|
56
56
|
--offset 0px
|
57
57
|
--hlscrollbar-bg #121212
|
58
58
|
--gap .5rem
|
59
|
-
--radius
|
59
|
+
--radius 12px
|
60
60
|
|
61
61
|
body
|
62
62
|
position relative
|
@@ -330,7 +330,7 @@ blockquote
|
|
330
330
|
background-color var(--efu-secondbg)
|
331
331
|
color var(--efu-secondtext)
|
332
332
|
border-radius 8px
|
333
|
-
margin
|
333
|
+
margin .5rem 0
|
334
334
|
padding .5rem .8rem
|
335
335
|
|
336
336
|
li, ul
|
@@ -18,12 +18,12 @@
|
|
18
18
|
display flex
|
19
19
|
flex-wrap wrap
|
20
20
|
flex-direction row
|
21
|
-
margin 1rem -.
|
21
|
+
margin 1rem -.125rem .5rem
|
22
22
|
|
23
23
|
.post-reward
|
24
24
|
position absolute
|
25
|
-
right
|
26
|
-
top
|
25
|
+
right 1rem
|
26
|
+
top 1rem
|
27
27
|
|
28
28
|
.reward-main
|
29
29
|
top 60px
|
@@ -57,26 +57,27 @@
|
|
57
57
|
padding 1rem
|
58
58
|
border-radius 12px
|
59
59
|
border var(--style-border-always)
|
60
|
-
width calc((100% / 6) - .
|
61
|
-
margin 0 .
|
60
|
+
width calc((100% / 6) - .25rem)
|
61
|
+
margin 0 .125rem .5rem .125rem
|
62
62
|
box-shadow var(--efu-shadow-border)
|
63
|
+
display flex
|
63
64
|
flex-direction column
|
64
65
|
justify-content space-between
|
65
66
|
|
66
67
|
+maxWidth1200()
|
67
|
-
width calc((100% / 4) - .
|
68
|
+
width calc((100% / 4) - .25rem)
|
68
69
|
|
69
70
|
+maxWidth900()
|
70
|
-
width calc((100% / 2) - .
|
71
|
+
width calc((100% / 2) - .25rem)
|
71
72
|
|
72
73
|
+maxWidth768()
|
73
|
-
width 100%
|
74
|
+
width calc((100% / 2) - .25rem)
|
74
75
|
|
75
76
|
.reward-list-item-name
|
76
77
|
font-size 1rem
|
77
78
|
font-weight 700
|
78
79
|
line-height 1
|
79
|
-
margin-bottom .
|
80
|
+
margin-bottom .25rem
|
80
81
|
white-space nowrap
|
81
82
|
overflow hidden
|
82
83
|
text-overflow ellipsis
|
@@ -96,12 +97,12 @@
|
|
96
97
|
align-items center
|
97
98
|
justify-content center
|
98
99
|
border-radius 4px
|
99
|
-
margin-right
|
100
|
+
margin-right 2px
|
100
101
|
white-space nowrap
|
101
102
|
|
102
103
|
.solitude
|
103
104
|
font-size 14px
|
104
|
-
margin-right
|
105
|
+
margin-right 2px
|
105
106
|
color var(--efu-card-bg)
|
106
107
|
|
107
108
|
.reward-list-item-time
|
@@ -112,4 +113,4 @@
|
|
112
113
|
.reward-list-tips
|
113
114
|
p
|
114
115
|
font-size 12px
|
115
|
-
color var(--efu-secondtext)
|
116
|
+
color var (--efu-secondtext)
|
@@ -11,8 +11,107 @@ if hexo-config('comment.commentBarrage')
|
|
11
11
|
|
12
12
|
@import "pagination"
|
13
13
|
|
14
|
-
if hexo-config('post_ai.enable')
|
15
|
-
@import "postAI"
|
16
|
-
|
17
14
|
if hexo-config('google_adsense.enable')
|
18
|
-
@import "ads.styl"
|
15
|
+
@import "ads.styl"
|
16
|
+
|
17
|
+
if hexo-config('post.ai.enable')
|
18
|
+
.post-ai
|
19
|
+
background var(--efu-secondbg)
|
20
|
+
border-radius 12px
|
21
|
+
padding 12px
|
22
|
+
line-height 1.3
|
23
|
+
border var(--style-border-always)
|
24
|
+
margin-top 16px
|
25
|
+
min-height 101.22px
|
26
|
+
box-shadow var(--efu-shadow-border)
|
27
|
+
|
28
|
+
+maxWidth768()
|
29
|
+
margin-top 0
|
30
|
+
|
31
|
+
.ai-title
|
32
|
+
display flex
|
33
|
+
color var(--efu-lighttext)
|
34
|
+
border-radius 8px
|
35
|
+
align-items center
|
36
|
+
user-select none
|
37
|
+
|
38
|
+
.ai-title-left
|
39
|
+
display flex
|
40
|
+
align-items center
|
41
|
+
color var(--efu-lighttext)
|
42
|
+
|
43
|
+
i.ai-title-icon
|
44
|
+
width 24px
|
45
|
+
height 24px
|
46
|
+
display flex
|
47
|
+
background var(--efu-lighttext)
|
48
|
+
color var(--efu-card-bg)
|
49
|
+
font-size 14px
|
50
|
+
border-radius 20px
|
51
|
+
justify-content center
|
52
|
+
align-items center
|
53
|
+
|
54
|
+
.ai-title-text
|
55
|
+
font-weight 700
|
56
|
+
margin-left 8px
|
57
|
+
line-height 1
|
58
|
+
font-size 14px
|
59
|
+
|
60
|
+
.ai-tag
|
61
|
+
font-size 12px
|
62
|
+
background-color var(--efu-lighttext)
|
63
|
+
box-shadow var(--efu-shadow-main)
|
64
|
+
color var(--efu-card-bg)
|
65
|
+
font-weight 700
|
66
|
+
border-radius 12px
|
67
|
+
margin-left auto
|
68
|
+
line-height 12px
|
69
|
+
padding 6px 8px
|
70
|
+
display flex
|
71
|
+
align-items center
|
72
|
+
justify-content center
|
73
|
+
transition .3s
|
74
|
+
|
75
|
+
&.loadingAI
|
76
|
+
animation-duration 2s
|
77
|
+
animation-name AILoading
|
78
|
+
animation-iteration-count infinite
|
79
|
+
animation-direction alternate
|
80
|
+
|
81
|
+
.ai-explanation
|
82
|
+
margin-top 12px
|
83
|
+
overflow hidden
|
84
|
+
padding 8px 12px
|
85
|
+
background var(--efu-card-bg)
|
86
|
+
border-radius 8px
|
87
|
+
border var(--style-border-always)
|
88
|
+
font-size 15px
|
89
|
+
line-height 1.4
|
90
|
+
display none
|
91
|
+
text-align left
|
92
|
+
|
93
|
+
.blinking-cursor
|
94
|
+
background-color var(--efu-lighttext)
|
95
|
+
width 14px
|
96
|
+
height 14px
|
97
|
+
border-radius 16px
|
98
|
+
display inline-block
|
99
|
+
vertical-align middle
|
100
|
+
animation blinking-cursor 2s infinite
|
101
|
+
margin-left 4px
|
102
|
+
margin-bottom 3px
|
103
|
+
transform scale(.6)
|
104
|
+
|
105
|
+
.char
|
106
|
+
display inline-block
|
107
|
+
opacity 0
|
108
|
+
animation chat-float .5s ease forwards;
|
109
|
+
|
110
|
+
@keyframes chat-float
|
111
|
+
0%
|
112
|
+
opacity 0
|
113
|
+
transform translateY(20px)
|
114
|
+
100%
|
115
|
+
opacity 1
|
116
|
+
transform translateY(0)
|
117
|
+
|
@@ -1,107 +1,47 @@
|
|
1
|
-
|
2
|
-
.article-container .tabs
|
1
|
+
.tabs
|
3
2
|
position relative
|
4
|
-
border 1px solid var(--tab-border-color)
|
5
|
-
|
6
|
-
> .nav-tabs
|
7
|
-
> .tab
|
8
|
-
margin 4px
|
9
|
-
padding 0
|
10
|
-
list-style none
|
11
|
-
|
12
|
-
+maxWidth768()
|
13
|
-
-webkit-box-flex 1
|
14
|
-
flex-grow 1
|
15
|
-
|
16
|
-
button i
|
17
|
-
width 1.5em
|
18
|
-
font-size inherit
|
19
|
-
|
20
|
-
&.active button
|
21
|
-
cursor default
|
22
|
-
border var(--style-border-hover-always)
|
23
|
-
background var(--efu-background)
|
24
|
-
border-radius 8px;
|
25
|
-
|
26
|
-
&:not(.active) button:hover
|
27
|
-
border-top 2px solid var(--tab-button-hover-bg)
|
28
|
-
background var(--tab-button-hover-bg)
|
29
|
-
|
30
|
-
> .tab-contents .tab-item-content
|
31
|
-
position relative
|
32
|
-
display none
|
33
|
-
padding 1.8rem 1.2rem
|
34
|
-
background var(--efu-background)
|
35
|
-
border var(--style-border-always)
|
36
|
-
|
37
|
-
+maxWidth768()
|
38
|
-
padding 1.2rem .7rem
|
39
|
-
|
40
|
-
&.active
|
41
|
-
display block
|
42
|
-
animation .5s ease 0s 1 normal none running tabshow
|
43
|
-
|
44
|
-
.tab-to-top
|
45
|
-
position relative
|
46
|
-
display block
|
47
|
-
margin 16px 0 0 auto
|
48
|
-
color #99a9bf
|
49
|
-
|
50
|
-
margin 1rem 0
|
51
|
-
border-radius 12px
|
52
|
-
overflow hidden
|
53
|
-
box-shadow var(--efu-shadow-border)
|
54
|
-
padding 8px
|
55
|
-
background var(--efu-card-bg)
|
56
|
-
border var(--style-border)
|
57
3
|
|
58
4
|
.nav-tabs
|
59
|
-
|
60
|
-
padding 16px
|
5
|
+
margin-top 0
|
61
6
|
display flex
|
62
|
-
|
63
|
-
flex-wrap wrap
|
64
|
-
flex-direction row
|
65
|
-
|
66
|
-
+maxWidth768()
|
67
|
-
padding 0
|
68
|
-
margin-bottom 8px
|
69
|
-
|
70
|
-
> .nav-tabs > .tab button
|
71
|
-
-webkit-transition all 0s
|
72
|
-
background var(--efu-secondbg)
|
73
|
-
transition .3s
|
7
|
+
background var(--efu-card-bg)
|
74
8
|
border var(--style-border-always)
|
75
|
-
border-radius
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
width 100%
|
81
|
-
justify-content center
|
82
|
-
align-items center
|
83
|
-
color var(--efu-fontcolor)
|
9
|
+
border-radius var(--radius)
|
10
|
+
margin-bottom .5rem
|
11
|
+
padding .3rem .5rem
|
12
|
+
gap .5rem
|
13
|
+
flex-wrap wrap
|
84
14
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
transition .3s
|
89
|
-
border var(--style-border-hover-always)
|
15
|
+
.tab
|
16
|
+
border-radius 6px
|
17
|
+
transition all 0.3s ease
|
90
18
|
|
91
|
-
|
92
|
-
|
19
|
+
button
|
20
|
+
width 100%
|
21
|
+
padding 0 .3rem
|
22
|
+
height 100%
|
23
|
+
font-size 14px
|
93
24
|
|
94
|
-
|
25
|
+
&.active
|
26
|
+
background var(--light-grey)
|
27
|
+
i,button
|
28
|
+
color var(--efu-card-bg)
|
95
29
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
padding 1.2rem
|
100
|
-
border-radius 8px
|
30
|
+
i
|
31
|
+
font-size 14px
|
32
|
+
margin-right .3rem
|
101
33
|
|
102
|
-
|
103
|
-
|
34
|
+
.tab-contents
|
35
|
+
padding .5rem
|
36
|
+
border var(--style-border-always)
|
37
|
+
border-radius var(--radius)
|
38
|
+
transition all 0.3s ease
|
104
39
|
|
105
|
-
.tab-
|
106
|
-
|
107
|
-
|
40
|
+
.tab-item-content.active
|
41
|
+
display block
|
42
|
+
opacity 1
|
43
|
+
transform translateY(0)
|
44
|
+
.tab-item-content
|
45
|
+
display none
|
46
|
+
opacity 0
|
47
|
+
transform translateY(-10px)
|
package/source/css/index.styl
CHANGED