hexo-theme-stellar 1.26.5 → 1.26.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 +10 -5
- package/layout/_partial/main/navbar/article_banner.ejs +9 -2
- package/layout/layout.ejs +4 -0
- package/package.json +1 -1
- package/scripts/tags/index.js +1 -0
- package/scripts/tags/lib/button.js +39 -0
- package/scripts/tags/lib/link.js +11 -0
- package/scripts/tags/lib/okr.js +1 -1
- package/source/css/_common/blockquote.styl +1 -1
- package/source/css/_common/highlight.styl +3 -3
- package/source/css/_custom.styl +3 -4
- package/source/css/_defines/func.styl +9 -4
- package/source/css/_defines/theme.styl +1 -0
- package/source/css/_layout/layout.styl +2 -2
- package/source/css/_layout/list.styl +1 -7
- package/source/css/_layout/md.styl +16 -13
- package/source/css/_layout/partial/article-banner.styl +1 -1
- package/source/css/_layout/partial/article-footer.styl +1 -1
- package/source/css/_layout/partial/related.styl +2 -6
- package/source/css/_layout/sidebar/sidebar.styl +1 -1
- package/source/css/_layout/tag-plugins/banner.styl +2 -0
- package/source/css/_layout/tag-plugins/button.styl +36 -0
- package/source/css/_layout/tag-plugins/folding.styl +1 -1
- package/source/css/_layout/tag-plugins/grid.styl +1 -2
- package/source/css/_layout/tag-plugins/image.styl +1 -1
- package/source/css/_layout/tag-plugins/link.styl +2 -3
- package/source/css/_layout/tag-plugins/note.styl +1 -1
- package/source/css/_layout/tag-plugins/okr.styl +11 -2
- package/source/css/_layout/widgets/ghrepo.styl +1 -1
- package/source/css/_plugins/aplayer.styl +1 -1
- package/source/css/_plugins/comments/artalk.styl +1 -1
- package/source/css/_plugins/comments/twikoo.styl +3 -3
- package/source/css/_plugins/copycode.styl +1 -1
- package/source/css/_plugins/tianli_gpt.styl +2 -2
- package/source/js/plugins/linkcard.js +4 -4
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.26.
|
|
3
|
+
version: '1.26.7'
|
|
4
4
|
homepage: 'https://xaoxuu.com/wiki/stellar/'
|
|
5
5
|
repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
|
|
6
6
|
main_css: /css/main.css
|
|
@@ -280,6 +280,11 @@ footer:
|
|
|
280
280
|
|
|
281
281
|
######## Tag Plugins ########
|
|
282
282
|
tag_plugins:
|
|
283
|
+
# {% link %}
|
|
284
|
+
linkcard:
|
|
285
|
+
# 设置 api 可以自动提取网页标题、图标,服务部署方法:https://github.com/xaoxuu/site-info-api/
|
|
286
|
+
# 接口测试通过后,把按钮的 href 部分替换成 ${href} 之后填写到下方,例如:https://api.vlts.cc/site_info/v1?url=${href}
|
|
287
|
+
api:
|
|
283
288
|
# {% box %} / {% note %}
|
|
284
289
|
note:
|
|
285
290
|
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
|
|
@@ -488,10 +493,10 @@ style:
|
|
|
488
493
|
prefix:
|
|
489
494
|
h2: https://api.iconify.design/ci:heading-h2.svg
|
|
490
495
|
border-radius:
|
|
491
|
-
card:
|
|
492
|
-
|
|
493
|
-
bar: 8px
|
|
494
|
-
image:
|
|
496
|
+
card-l: 16px # 侧边栏、文章横幅位置的圆角
|
|
497
|
+
card: 12px # 文章内大部分卡片的圆角
|
|
498
|
+
bar: 8px # 横条类元素的圆角
|
|
499
|
+
image: 12px # 图片圆角
|
|
495
500
|
color:
|
|
496
501
|
# 动态颜色(会根据明暗主题重设明度值,只用关心色相和饱和度即可)
|
|
497
502
|
background: 'hsl(212 16% 98%)' # 浅色背景颜色
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
<%
|
|
2
2
|
|
|
3
|
-
var banner_url
|
|
3
|
+
var banner_url
|
|
4
|
+
if (page.banner) {
|
|
5
|
+
banner_url = page.banner
|
|
6
|
+
} else if (theme.topic.tree[page.topic]?.banner != null) {
|
|
7
|
+
banner_url = theme.topic.tree[page.topic]?.banner
|
|
8
|
+
} else if (theme.wiki.tree[page.wiki]?.banner != null) {
|
|
9
|
+
banner_url = theme.wiki.tree[page.wiki]?.banner
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
function layoutTitle() {
|
|
6
13
|
const title = page.h1 != null ? page.h1 : page.title
|
|
@@ -35,7 +42,7 @@ function layoutDiv() {
|
|
|
35
42
|
var style = ``
|
|
36
43
|
var el = ``
|
|
37
44
|
el += `<div class="article banner top">`
|
|
38
|
-
if (banner_url
|
|
45
|
+
if (banner_url?.length > 0) {
|
|
39
46
|
el += `<img class="bg" src="${banner_url}">`
|
|
40
47
|
if (page.poster?.color) {
|
|
41
48
|
style += ' style="--text-banner:' + page.poster?.color + '"'
|
package/layout/layout.ejs
CHANGED
|
@@ -10,6 +10,10 @@ if (['post', 'page', 'wiki', null].includes(page.layout)) {
|
|
|
10
10
|
var article_type = theme.article.type
|
|
11
11
|
if (page.type?.length > 0) {
|
|
12
12
|
article_type = page.type
|
|
13
|
+
} else if (theme.topic.tree[page.topic]?.type != null) {
|
|
14
|
+
article_type = theme.topic.tree[page.topic]?.type
|
|
15
|
+
} else if (theme.wiki.tree[page.wiki]?.type != null) {
|
|
16
|
+
article_type = theme.wiki.tree[page.wiki]?.type
|
|
13
17
|
}
|
|
14
18
|
// 是否缩进
|
|
15
19
|
var indent = false
|
package/package.json
CHANGED
package/scripts/tags/index.js
CHANGED
|
@@ -33,6 +33,7 @@ hexo.extend.tag.register('icon', require('./lib/icon')(hexo))
|
|
|
33
33
|
hexo.extend.tag.register('frame', require('./lib/frame')(hexo))
|
|
34
34
|
hexo.extend.tag.register('image', require('./lib/image')(hexo))
|
|
35
35
|
hexo.extend.tag.register('link', require('./lib/link')(hexo))
|
|
36
|
+
hexo.extend.tag.register('button', require('./lib/button')(hexo))
|
|
36
37
|
hexo.extend.tag.register('mark', require('./lib/mark')(hexo))
|
|
37
38
|
hexo.extend.tag.register('navbar', require('./lib/navbar')(hexo))
|
|
38
39
|
hexo.extend.tag.register('note', require('./lib/note')(hexo))
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* button.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% button [color:color] text url [icon:key/src] [size:xs] %}
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
|
|
11
|
+
module.exports = ctx => function(args) {
|
|
12
|
+
args = ctx.args.map(args, ['color', 'icon', 'size'], ['text', 'url'])
|
|
13
|
+
if (!args.text) {
|
|
14
|
+
return ''
|
|
15
|
+
}
|
|
16
|
+
if (!args.url) {
|
|
17
|
+
return ''
|
|
18
|
+
}
|
|
19
|
+
if (args.url.includes(' ')) {
|
|
20
|
+
var arr = args.url.split(' ')
|
|
21
|
+
args.url = arr.pop()
|
|
22
|
+
args.text = `${args.text} ${arr.join(' ')}`
|
|
23
|
+
}
|
|
24
|
+
if (args.color == null) {
|
|
25
|
+
args.color = 'theme'
|
|
26
|
+
}
|
|
27
|
+
var el = ''
|
|
28
|
+
el += '<a class="tag-plugin colorful button"'
|
|
29
|
+
el += ' ' + ctx.args.joinTags(args, ['color', 'size']).join(' ')
|
|
30
|
+
el += ` title="${args.text}"`
|
|
31
|
+
el += ` href="${args.url}"`
|
|
32
|
+
el += '>'
|
|
33
|
+
if (args.icon) {
|
|
34
|
+
el += ctx.utils.icon(args.icon)
|
|
35
|
+
}
|
|
36
|
+
el += `<span>${args.text}</span>`
|
|
37
|
+
el += '</a>'
|
|
38
|
+
return el
|
|
39
|
+
}
|
package/scripts/tags/lib/link.js
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
module.exports = ctx => function(args) {
|
|
11
11
|
const full_url_for = require('hexo-util').full_url_for.bind(ctx)
|
|
12
12
|
args = ctx.args.map(args, ['icon', 'desc'], ['url', 'title'])
|
|
13
|
+
if (args.url == null) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
const url = full_url_for(args.url)
|
|
17
|
+
args.api = ctx.theme.config.tag_plugins.linkcard.api
|
|
18
|
+
if (args.api) {
|
|
19
|
+
args.api = args.api.replace('${href}', url)
|
|
20
|
+
}
|
|
13
21
|
var autofill = []
|
|
14
22
|
if (!args.title) {
|
|
15
23
|
autofill.push('title')
|
|
@@ -27,6 +35,9 @@ module.exports = ctx => function(args) {
|
|
|
27
35
|
el += ' target="_blank" rel="external nofollow noopener noreferrer"'
|
|
28
36
|
}
|
|
29
37
|
el += ' cardlink'
|
|
38
|
+
if (args.api) {
|
|
39
|
+
el += ` api="${args.api}"`
|
|
40
|
+
}
|
|
30
41
|
el += ' autofill="'
|
|
31
42
|
el += autofill.join(',')
|
|
32
43
|
el += '"'
|
package/scripts/tags/lib/okr.js
CHANGED
|
@@ -56,7 +56,7 @@ function generateKRList(ctx, contentArray) {
|
|
|
56
56
|
function layoutItem(ctx, type, index, title, note, color, label, percent) {
|
|
57
57
|
const percentStr = (percent * 100).toString().replace(/\.\d*/, '')
|
|
58
58
|
return `
|
|
59
|
-
<div class="okr-item ${type}">
|
|
59
|
+
<div class="okr-item ${type}" id="okr-${index.toLowerCase()}">
|
|
60
60
|
<div class="okr-left">
|
|
61
61
|
<span class="title">${index.toUpperCase()}</span>
|
|
62
62
|
</div>
|
|
@@ -12,7 +12,7 @@ p>code:not([class]),li>code:not([class])
|
|
|
12
12
|
|
|
13
13
|
.md-text .highlight, pre:not([class]):has(>code)
|
|
14
14
|
margin: var(--gap-p) 0
|
|
15
|
-
border-radius: $border-
|
|
15
|
+
border-radius: $border-card
|
|
16
16
|
overflow: hidden
|
|
17
17
|
background: var(--block)
|
|
18
18
|
line-height: 1.5
|
|
@@ -78,7 +78,7 @@ p>code:not([class]),li>code:not([class])
|
|
|
78
78
|
--fgColor-default: var(--text-p1)
|
|
79
79
|
.gist-file
|
|
80
80
|
border: 1px solid var(--block-border)
|
|
81
|
-
border-radius: $border-
|
|
81
|
+
border-radius: $border-card
|
|
82
82
|
overflow: hidden
|
|
83
83
|
.gist-data
|
|
84
84
|
border-bottom: 1px solid var(--block-border)
|
|
@@ -102,7 +102,7 @@ table:not([class])
|
|
|
102
102
|
color: var(--text-p3)
|
|
103
103
|
>.hljs
|
|
104
104
|
padding: 1rem
|
|
105
|
-
border-radius: $border-
|
|
105
|
+
border-radius: $border-card
|
|
106
106
|
line-height: 1.5
|
|
107
107
|
box-sizing: border-box
|
|
108
108
|
|
package/source/css/_custom.styl
CHANGED
|
@@ -59,8 +59,8 @@ $fsp1 = 'calc(%s - 1px)' % $fs-body
|
|
|
59
59
|
$fsp2 = 'calc(%s - 2px)' % $fs-body
|
|
60
60
|
$fsp3 = 'calc(%s - 3px)' % $fs-body
|
|
61
61
|
|
|
62
|
+
$border-card-l = convert(hexo-config('style.border-radius.card-l'))
|
|
62
63
|
$border-card = convert(hexo-config('style.border-radius.card'))
|
|
63
|
-
$border-block = convert(hexo-config('style.border-radius.block'))
|
|
64
64
|
$border-bar = convert(hexo-config('style.border-radius.bar'))
|
|
65
65
|
$border-image = convert(hexo-config('style.border-radius.image'))
|
|
66
66
|
$border-button = 4px
|
|
@@ -95,9 +95,8 @@ $border-button = 4px
|
|
|
95
95
|
|
|
96
96
|
// 文章布局风格
|
|
97
97
|
.l_body.story
|
|
98
|
-
--
|
|
99
|
-
|
|
100
|
-
.tag-plugin,p>img
|
|
98
|
+
--gap-p: 2rem
|
|
99
|
+
div.tag-plugin,p>img
|
|
101
100
|
margin-top: 2.4rem
|
|
102
101
|
margin-bottom: 2.4rem
|
|
103
102
|
|
|
@@ -104,7 +104,12 @@ floatable-float()
|
|
|
104
104
|
box-shadow: 0 12px 20px -4px rgba(0, 0, 0, 0.15)
|
|
105
105
|
transform: translate3d(0, -2px, 0)
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
hoverable-card()
|
|
108
|
+
trans1 all
|
|
109
|
+
@media (prefers-color-scheme: dark)
|
|
110
|
+
&:hover
|
|
111
|
+
box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
|
|
112
|
+
@media (prefers-color-scheme: light)
|
|
113
|
+
box-shadow: $boxshadow-card
|
|
114
|
+
&:hover
|
|
115
|
+
floatable-float()
|
|
@@ -25,13 +25,7 @@
|
|
|
25
25
|
margin: 1rem 0
|
|
26
26
|
border-radius: $border-card
|
|
27
27
|
background: var(--card)
|
|
28
|
-
|
|
29
|
-
&:hover
|
|
30
|
-
box-shadow: 0 0 4px -2px $color-theme, 0 0 24px -8px $color-theme
|
|
31
|
-
@media (prefers-color-scheme: light)
|
|
32
|
-
box-shadow: $boxshadow-card
|
|
33
|
-
hover-float()
|
|
34
|
-
trans1 all
|
|
28
|
+
hoverable-card()
|
|
35
29
|
overflow: hidden
|
|
36
30
|
z-index: 0
|
|
37
31
|
|
|
@@ -108,16 +108,19 @@
|
|
|
108
108
|
margin: auto
|
|
109
109
|
display: block
|
|
110
110
|
|
|
111
|
-
.md-text
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
111
|
+
.md-text li:not([class]) a:not([class]), .md-text p:not([class]) a:not([class])
|
|
112
|
+
position: relative
|
|
113
|
+
text-decoration: none
|
|
114
|
+
trans1 all
|
|
115
|
+
padding: 0 2px
|
|
116
|
+
border-radius: 0
|
|
117
|
+
background: linear-gradient(0deg,var(--theme-link),var(--theme-link)) no-repeat left 100%/100% 1px
|
|
118
|
+
&:hover
|
|
119
|
+
color: var(--theme-link)
|
|
120
|
+
border-radius: 4px
|
|
121
|
+
background: linear-gradient(0deg,var(--theme-link-opa),var(--theme-link-opa)) no-repeat left 100%/100% 100%
|
|
122
|
+
&:has(img)
|
|
123
|
+
background: none
|
|
124
|
+
padding: 0
|
|
125
|
+
&:hover
|
|
126
|
+
background: none
|
|
@@ -94,12 +94,8 @@ article.md-text.content+.related-wrap
|
|
|
94
94
|
margin: 0
|
|
95
95
|
font-size: inherit
|
|
96
96
|
a
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
&:hover
|
|
100
|
-
color: $color-hover
|
|
101
|
-
&:before
|
|
102
|
-
display: none
|
|
97
|
+
--theme-link: $color-theme
|
|
98
|
+
--theme-link-opa: rgba($color-theme, 0.2)
|
|
103
99
|
.cmt-body
|
|
104
100
|
min-height: 150px
|
|
105
101
|
position: relative
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
a.tag-plugin.button
|
|
2
|
+
background: var(--theme)
|
|
3
|
+
color: var(--alpha100)
|
|
4
|
+
display: inline-flex
|
|
5
|
+
align-items: center
|
|
6
|
+
justify-content: center
|
|
7
|
+
padding: 0 4px
|
|
8
|
+
trans1 background
|
|
9
|
+
margin-top: 8px
|
|
10
|
+
margin-bottom: 8px
|
|
11
|
+
svg,img
|
|
12
|
+
height: 24px
|
|
13
|
+
width: auto
|
|
14
|
+
margin: 0 -0.5em 0 1em
|
|
15
|
+
flex-shrink: 0
|
|
16
|
+
span
|
|
17
|
+
text-indent: 0
|
|
18
|
+
line-height: 24px
|
|
19
|
+
margin: 8px 1em
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
a.tag-plugin.button[size='xs']
|
|
23
|
+
margin: 0
|
|
24
|
+
border-radius: 2px
|
|
25
|
+
svg,img
|
|
26
|
+
margin: 0 2px 0 0
|
|
27
|
+
height: 1em
|
|
28
|
+
span
|
|
29
|
+
margin: 0
|
|
30
|
+
|
|
31
|
+
a.tag-plugin.button:hover
|
|
32
|
+
--theme: $color-hover
|
|
33
|
+
|
|
34
|
+
.tag-plugin.grid a.tag-plugin.button
|
|
35
|
+
width: 100%
|
|
36
|
+
box-sizing: border-box
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.md-text .tag-plugin.okr
|
|
2
2
|
position: relative
|
|
3
|
-
border-radius: $border-
|
|
3
|
+
border-radius: $border-card
|
|
4
4
|
background: var(--theme-block)
|
|
5
5
|
if hexo-config('tag_plugins.okr.border') == true
|
|
6
6
|
border: 1px solid var(--theme-border)
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
justify-content: space-between
|
|
63
63
|
align-items: flex-start
|
|
64
64
|
position relative
|
|
65
|
+
flex-wrap: wrap
|
|
65
66
|
.label
|
|
66
67
|
background: var(--theme-block)
|
|
67
68
|
color: var(--text-p1)
|
|
@@ -102,4 +103,12 @@
|
|
|
102
103
|
background: var(--theme)
|
|
103
104
|
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
@media screen and (max-width: $device-mobile-max)
|
|
107
|
+
.tag-plugin.okr .okr-item
|
|
108
|
+
grid-template-columns: 2.8rem auto 50px
|
|
109
|
+
grid-column-gap: 0.5rem
|
|
110
|
+
padding: 0.5rem
|
|
111
|
+
.okr-left .title
|
|
112
|
+
padding: 0 0.25rem
|
|
113
|
+
.label
|
|
114
|
+
txt-ellipsis()
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
width: auto
|
|
59
59
|
border: none
|
|
60
60
|
padding: 6px 2rem
|
|
61
|
-
border-radius: $border-
|
|
61
|
+
border-radius: $border-card
|
|
62
62
|
background: var(--block)
|
|
63
63
|
color: var(--text-p1)
|
|
64
64
|
line-height: 2
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
margin-bottom: 1rem
|
|
75
75
|
border: 1px dashed var(--block-border);
|
|
76
76
|
padding: 1rem;
|
|
77
|
-
border-radius: $border-
|
|
77
|
+
border-radius: $border-card;
|
|
78
78
|
background: var(--card);
|
|
79
79
|
|
|
80
80
|
&:hover
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
|
|
87
87
|
.tk-submit
|
|
88
88
|
padding: 1rem 1rem 0 1rem;
|
|
89
|
-
border-radius: $border-
|
|
89
|
+
border-radius: $border-card;
|
|
90
90
|
background: var(--card);
|
|
91
91
|
|
|
92
92
|
.tk-tag
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.post-TianliGPT
|
|
20
20
|
background: var(--block)
|
|
21
|
-
border-radius: $border-
|
|
21
|
+
border-radius: $border-card
|
|
22
22
|
padding: 12px
|
|
23
23
|
line-height: 1.3
|
|
24
24
|
border: var(--style-border-always)
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
margin-top: 12px
|
|
45
45
|
padding: 8px 12px
|
|
46
46
|
background: var(--card)
|
|
47
|
-
border-radius: $border-
|
|
47
|
+
border-radius: $border-card
|
|
48
48
|
border: var(--style-border-always)
|
|
49
49
|
font-size: 15px
|
|
50
50
|
line-height: 1.4
|
|
@@ -30,11 +30,11 @@ function setCardLink(nodes) {
|
|
|
30
30
|
nodes = 'forEach' in (nodes || {}) ? nodes : document.querySelectorAll('a[cardlink]')
|
|
31
31
|
nodes.forEach((el) => {
|
|
32
32
|
// If it is not a tag element then it is not processed
|
|
33
|
-
if (el.nodeType !== 1) return
|
|
33
|
+
if (el.nodeType !== 1) return;
|
|
34
34
|
el.removeAttribute('cardlink');
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
fetch(api
|
|
35
|
+
const api = el.getAttribute('api');
|
|
36
|
+
if (api == null) return;
|
|
37
|
+
fetch(api).then(function(response) {
|
|
38
38
|
if (response.ok) {
|
|
39
39
|
return response.json();
|
|
40
40
|
}
|