hexo-theme-stellar 1.29.1 → 1.30.1
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 +29 -7
- package/_data/chat_users.yml +0 -0
- package/_data/icons.yml +3 -1
- package/_data/widgets.yml +7 -0
- package/layout/_partial/head.ejs +2 -1
- package/layout/_partial/main/navbar/nav_tabs_blog.ejs +10 -10
- package/layout/_partial/main/post_list/post_card.ejs +15 -11
- package/layout/_partial/scripts/defines.ejs +3 -0
- package/layout/_partial/scripts/services.ejs +91 -0
- package/layout/_partial/scripts/theme.ejs +5 -0
- package/layout/_partial/scripts/utils.ejs +67 -7
- package/layout/_partial/scripts.ejs +1 -1
- package/layout/_plugins/mermaid.ejs +1 -1
- package/layout/_plugins/scrollreveal.ejs +1 -0
- package/layout/_plugins/search/algolia_search.ejs +11 -12
- package/layout/layout.ejs +1 -1
- package/package.json +1 -1
- package/scripts/events/lib/config.js +3 -0
- package/scripts/events/lib/doc_tree.js +1 -6
- package/scripts/filters/index.js +26 -0
- package/scripts/generators/notebooks.js +1 -1
- package/scripts/generators/search.js +21 -2
- package/scripts/helpers/dynamic_color.js +138 -0
- package/scripts/tags/index.js +1 -0
- package/scripts/tags/lib/box.js +1 -1
- package/scripts/tags/lib/chat.js +515 -0
- package/scripts/tags/lib/folders.js +1 -1
- package/scripts/tags/lib/folding.js +2 -2
- package/scripts/tags/lib/friends.js +4 -4
- package/scripts/tags/lib/sites.js +1 -1
- package/scripts/tags/lib/video.js +7 -2
- package/source/css/_components/list.styl +41 -12
- package/source/css/_components/partial/article-banner.styl +23 -9
- package/source/css/_components/tag-plugins/chat.styl +621 -0
- package/source/css/_components/tag-plugins/friends.styl +9 -0
- package/source/css/_components/tag-plugins/friends_posts.styl +160 -0
- package/source/css/_components/tag-plugins/sites.styl +25 -0
- package/source/css/_components/tag-plugins/tabs.styl +5 -2
- package/source/css/_custom.styl +1 -0
- package/source/css/_defines/func.styl +7 -6
- package/source/css/_defines/theme.styl +38 -0
- package/source/css/_plugins/katex.styl +0 -1
- package/source/js/plugins/download-file.js +198 -0
- package/source/js/plugins/video.js +65 -0
- package/source/js/plugins/voice.js +438 -0
- package/source/js/search/algolia-search.js +63 -61
- package/source/js/services/artalk_latest_comment.js +33 -0
- package/source/js/services/friends.js +4 -0
- package/source/js/services/friends_and_posts.js +57 -0
- package/source/js/services/giscus_latest_comment.js +36 -0
- package/source/js/services/memos.js +91 -69
- package/source/js/services/sites.js +12 -1
- package/source/js/services/twikoo_latest_comment.js +47 -0
- package/source/js/services/waline_latest_comment.js +32 -0
|
@@ -39,7 +39,7 @@ module.exports = ctx => function(args, content) {
|
|
|
39
39
|
nodes.forEach((node, i) => {
|
|
40
40
|
el += '<details class="folder" index="' + (i) + '">'
|
|
41
41
|
// summary
|
|
42
|
-
el += '<summary
|
|
42
|
+
el += '<summary>' + ctx.render.renderSync({text: (node.header || ''), engine: 'markdown'}) + '</summary>'
|
|
43
43
|
// content
|
|
44
44
|
el += '<div class="body">'
|
|
45
45
|
el += ctx.render.renderSync({text: (node.body || ''), engine: 'markdown'}).split('\n').join('')
|
|
@@ -20,10 +20,10 @@ module.exports = ctx => function(args, content) {
|
|
|
20
20
|
}
|
|
21
21
|
el += '>'
|
|
22
22
|
// summary
|
|
23
|
-
el += '<summary
|
|
23
|
+
el += '<summary>' + ctx.render.renderSync({text: (args.title || ''), engine: 'markdown'}) + '</summary>'
|
|
24
24
|
// content
|
|
25
25
|
el += '<div class="body">'
|
|
26
|
-
el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
|
|
26
|
+
el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join(' ')
|
|
27
27
|
el += '</div></details>'
|
|
28
28
|
|
|
29
29
|
return el
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* friends.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* {% friends [group] [repo:owner/repo] [api:http] %}
|
|
5
|
+
* {% friends [group] [repo:owner/repo] [posts:true/false] [api:http] %}
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict'
|
|
9
9
|
|
|
10
10
|
module.exports = ctx => function(args) {
|
|
11
|
-
args = ctx.args.map(args, ['repo', 'api'], ['group'])
|
|
11
|
+
args = ctx.args.map(args, ['repo', 'api', 'posts'], ['group'])
|
|
12
12
|
var api
|
|
13
13
|
if (args.api) {
|
|
14
14
|
api = args.api
|
|
@@ -16,9 +16,9 @@ module.exports = ctx => function(args) {
|
|
|
16
16
|
api = 'https://api.vlts.cc/output_data/v2/' + args.repo
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
var el =
|
|
19
|
+
var el = `<div class="tag-plugin ${args.posts ? 'users-posts-wrap' : 'users-wrap'}">`
|
|
20
20
|
if (api) {
|
|
21
|
-
el += `<div class="ds-friends" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
|
|
21
|
+
el += `<div class="ds-friends${args.posts ? '_and_posts' : ''}" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
|
|
22
22
|
} else if (args.group) {
|
|
23
23
|
const links = ctx.theme.config.links || {}
|
|
24
24
|
el += '<div class="grid-box">'
|
|
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
|
|
|
30
30
|
if (item?.url && item?.title) {
|
|
31
31
|
el += `<div class="grid-cell site-card">`
|
|
32
32
|
el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
|
|
33
|
-
el += `<img src="${item.cover || item.screenshot || ('https://
|
|
33
|
+
el += `<img src="${item.cover || item.snapshot || item.screenshot || ('https://image.thum.io/get/width/1280/crop/720/' + item.url)}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
34
34
|
el += `<div class="info">`
|
|
35
35
|
el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.link}" onerror="javascript:this.removeAttribute("data-src");this.src="${item.icon || item.avatar || ctx.theme.config.default.link}";"/>`
|
|
36
36
|
el += `<span class="title">${item.title}</span>`
|
|
@@ -21,8 +21,13 @@ module.exports = ctx => function (args) {
|
|
|
21
21
|
`
|
|
22
22
|
}
|
|
23
23
|
if (args.youtube) {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if(args.autoplay == 'true' || args.autoplay == '1') {
|
|
25
|
+
args.autoplay = '1&mute=1'
|
|
26
|
+
} else {
|
|
27
|
+
args.autoplay = '0'
|
|
28
|
+
}
|
|
29
|
+
return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
|
|
30
|
+
<iframe style="border:none" src="https://www.youtube.com/embed/${args.youtube}?rel=0&disablekb=1&playsinline=1&autoplay=${args.autoplay}" picture-in-picture="true" allowfullscreen="true" >
|
|
26
31
|
</iframe>
|
|
27
32
|
</div>
|
|
28
33
|
`
|
|
@@ -23,13 +23,23 @@
|
|
|
23
23
|
.post-list .post-card
|
|
24
24
|
display: block
|
|
25
25
|
margin: 1rem 0
|
|
26
|
-
border-radius: $border-card
|
|
26
|
+
border-radius: $border-card-l
|
|
27
27
|
background: var(--card)
|
|
28
28
|
hoverable-card()
|
|
29
29
|
overflow: hidden
|
|
30
30
|
z-index: 0
|
|
31
|
-
|
|
32
31
|
position: relative
|
|
32
|
+
--img-br: 100%
|
|
33
|
+
--img-sat: 100%
|
|
34
|
+
--blur-px: 1em
|
|
35
|
+
--blur-sat: 120%
|
|
36
|
+
&:hover
|
|
37
|
+
--img-br: 75%
|
|
38
|
+
--img-sat: 120%
|
|
39
|
+
--blur-sat: 200%
|
|
40
|
+
img
|
|
41
|
+
filter: brightness(var(--img-br)) saturate(var(--img-sat))
|
|
42
|
+
trans1 all
|
|
33
43
|
.excerpt
|
|
34
44
|
margin: 1rem 0
|
|
35
45
|
@media screen and (max-width: $device-mobile)
|
|
@@ -62,9 +72,6 @@
|
|
|
62
72
|
svg
|
|
63
73
|
color: $c-red
|
|
64
74
|
|
|
65
|
-
.post-list.post .post-card:hover
|
|
66
|
-
img
|
|
67
|
-
filter: brightness(50%)
|
|
68
75
|
|
|
69
76
|
// common article
|
|
70
77
|
.post-list .md-text
|
|
@@ -100,7 +107,23 @@
|
|
|
100
107
|
img
|
|
101
108
|
width: 100%
|
|
102
109
|
object-fit: cover
|
|
103
|
-
aspect-ratio: hexo-config('article.cover_ratio')
|
|
110
|
+
aspect-ratio: hexo-config('article.cover_ratio')
|
|
111
|
+
z-index 0
|
|
112
|
+
&:before
|
|
113
|
+
content: ''
|
|
114
|
+
z-index 1
|
|
115
|
+
position: absolute
|
|
116
|
+
left: 0
|
|
117
|
+
right: 0
|
|
118
|
+
height: 128px
|
|
119
|
+
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
120
|
+
trans1 all
|
|
121
|
+
&[position=top]:before
|
|
122
|
+
top: 0
|
|
123
|
+
mask: linear-gradient(black, rgba(black, 0.75), transparent)
|
|
124
|
+
&[position=bottom]:before
|
|
125
|
+
bottom: 0
|
|
126
|
+
mask: linear-gradient(transparent, rgba(black, 0.75), black)
|
|
104
127
|
.cover-info
|
|
105
128
|
padding: 1.5rem 1rem
|
|
106
129
|
position: absolute
|
|
@@ -108,6 +131,7 @@
|
|
|
108
131
|
width: 'calc(100% - %s * 2)' % 1rem
|
|
109
132
|
--text-banner: white
|
|
110
133
|
color: var(--text-banner)
|
|
134
|
+
z-index: 2
|
|
111
135
|
&[position=top]
|
|
112
136
|
top: 0
|
|
113
137
|
background-image: linear-gradient(rgba(0,0,0,0.2),rgba(0,0,0,0))
|
|
@@ -116,20 +140,25 @@
|
|
|
116
140
|
background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2))
|
|
117
141
|
div+div
|
|
118
142
|
margin-top: 4px
|
|
119
|
-
.
|
|
120
|
-
font-size: $fs-13
|
|
143
|
+
.text
|
|
121
144
|
color: unset
|
|
122
|
-
|
|
145
|
+
trans1 all
|
|
146
|
+
text-shadow: 0 2px 4px rgba(0,0,0,0.2)
|
|
147
|
+
.topic
|
|
148
|
+
font-size: $fs-13
|
|
149
|
+
.headline
|
|
123
150
|
font-weight: 500
|
|
124
151
|
font-size: $fsh3
|
|
152
|
+
.caption
|
|
153
|
+
font-size: $fs-14
|
|
125
154
|
@media screen and (max-width: $device-mobile)
|
|
126
155
|
padding: 1rem
|
|
127
156
|
div+div
|
|
128
157
|
margin-top: 2px
|
|
129
|
-
.
|
|
158
|
+
.headline
|
|
130
159
|
font-size: $fsh4
|
|
131
|
-
.
|
|
132
|
-
font-size: $fs-
|
|
160
|
+
.caption
|
|
161
|
+
font-size: $fs-13
|
|
133
162
|
h2
|
|
134
163
|
margin: .25rem 0
|
|
135
164
|
font-size: $fsh4
|
|
@@ -31,20 +31,34 @@
|
|
|
31
31
|
// 动画配置
|
|
32
32
|
.article.banner
|
|
33
33
|
.bg+.content
|
|
34
|
-
trans1 all
|
|
35
34
|
--blur-bg: rgba(black, 0)
|
|
36
35
|
--blur-px: 0px
|
|
37
36
|
--blur-sat: 100%
|
|
38
|
-
|
|
39
|
-
@supports ((-webkit-backdrop-filter:blur(var(--blur-px))) or (backdrop-filter:blur(var(--blur-px))))
|
|
40
|
-
background: var(--blur-bg)
|
|
41
|
-
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
42
|
-
-webkit-backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
43
|
-
&:hover
|
|
44
|
-
.bg+.content
|
|
37
|
+
&:hover
|
|
45
38
|
--blur-bg: rgba(black, 0.1)
|
|
46
|
-
--blur-px:
|
|
39
|
+
--blur-px: 1em
|
|
47
40
|
--blur-sat: 150%
|
|
41
|
+
background: var(--blur-bg)
|
|
42
|
+
trans1 all
|
|
43
|
+
&:before,&:after
|
|
44
|
+
content: ''
|
|
45
|
+
position: absolute
|
|
46
|
+
z-index 0
|
|
47
|
+
left: 0
|
|
48
|
+
width: 100%
|
|
49
|
+
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
50
|
+
trans1 all
|
|
51
|
+
&:before
|
|
52
|
+
top: 0
|
|
53
|
+
height: 4rem
|
|
54
|
+
mask: linear-gradient(black, rgba(black, 0.75), transparent)
|
|
55
|
+
&:after
|
|
56
|
+
bottom: 0
|
|
57
|
+
height: 5rem
|
|
58
|
+
mask: linear-gradient(transparent, rgba(black, 0.75), black)
|
|
59
|
+
.top,.bottom
|
|
60
|
+
z-index 1
|
|
61
|
+
|
|
48
62
|
|
|
49
63
|
.article.banner
|
|
50
64
|
--button-hover-bg: rgba(black, 0.05)
|