hexo-theme-stellar 1.26.6 → 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 +6 -1
- package/package.json +1 -1
- package/scripts/tags/lib/link.js +11 -0
- 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/related.styl +2 -6
- package/source/css/_layout/tag-plugins/grid.styl +1 -2
- package/source/css/_layout/tag-plugins/link.styl +1 -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
|
package/package.json
CHANGED
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 += '"'
|
|
@@ -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
|
|
@@ -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
|
}
|