hexo-theme-stellar 1.16.0 → 1.16.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/_config.yml +6 -3
- package/layout/_partial/sidebar/index.ejs +15 -5
- package/layout/_partial/sidebar/widgets/ghissues.ejs +3 -4
- package/layout/_partial/sidebar/widgets/ghrepo.ejs +3 -4
- package/layout/_partial/sidebar/widgets/ghuser.ejs +1 -1
- package/layout/_partial/sidebar/widgets/markdown.ejs +7 -7
- package/layout/_partial/sidebar/widgets/recent.ejs +1 -0
- package/layout/archive.ejs +1 -1
- package/layout/categories.ejs +1 -1
- package/layout/tags.ejs +1 -1
- package/layout/wiki.ejs +2 -2
- package/package.json +1 -1
- package/scripts/tags/mark.js +3 -0
- package/source/css/_layout/tag-plugins/common.styl +2 -2
- package/source/js/plugins/timeline.js +1 -1
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.16.
|
|
3
|
+
version: '1.16.2'
|
|
4
4
|
homepage: 'https://xaoxuu.com/wiki/stellar/'
|
|
5
5
|
repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
|
|
6
6
|
cdn_css: # Use cdn links instead of /css/main.css
|
|
@@ -49,7 +49,7 @@ article:
|
|
|
49
49
|
auto_excerpt: 200
|
|
50
50
|
# 分类颜色
|
|
51
51
|
category_color:
|
|
52
|
-
'
|
|
52
|
+
'探索号': '#f44336'
|
|
53
53
|
# 文章许可协议
|
|
54
54
|
license: '本文采用[署名-非商业性使用-相同方式共享 4.0 国际](https://creativecommons.org/licenses/by-nc-sa/4.0/)许可协议,转载请注明出处。'
|
|
55
55
|
# 分享
|
|
@@ -194,7 +194,7 @@ footer:
|
|
|
194
194
|
tag_plugins:
|
|
195
195
|
# {% note text %}
|
|
196
196
|
note:
|
|
197
|
-
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple
|
|
197
|
+
default_color: '' # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
|
|
198
198
|
# {% checkbox %}
|
|
199
199
|
checkbox:
|
|
200
200
|
interactive: false # enable interactive for user
|
|
@@ -219,6 +219,9 @@ tag_plugins:
|
|
|
219
219
|
# {% timeline %}
|
|
220
220
|
timeline:
|
|
221
221
|
max-height: 80vh
|
|
222
|
+
# {% mark %}
|
|
223
|
+
mark:
|
|
224
|
+
default_color: dark # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
|
|
222
225
|
|
|
223
226
|
|
|
224
227
|
######## JS Plugins ########
|
|
@@ -73,11 +73,21 @@ function layoutWidgets() {
|
|
|
73
73
|
}
|
|
74
74
|
if (page.sidebar) {
|
|
75
75
|
page.sidebar.forEach((w, i) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
let name = ''
|
|
77
|
+
let widget = {}
|
|
78
|
+
if (typeof w == 'string') {
|
|
79
|
+
name = w
|
|
80
|
+
} else if (typeof w == 'object' && w.override) {
|
|
81
|
+
name = w.override
|
|
82
|
+
}
|
|
83
|
+
if (name in theme.data.widgets) {
|
|
84
|
+
Object.assign(widget, theme.data.widgets[name])
|
|
85
|
+
}
|
|
86
|
+
if (typeof w == 'object' && w.override) {
|
|
87
|
+
Object.assign(widget, w)
|
|
88
|
+
}
|
|
89
|
+
if (widget && widget.layout) {
|
|
90
|
+
el += partial('widgets/' + widget.layout, {item: widget})
|
|
81
91
|
}
|
|
82
92
|
});
|
|
83
93
|
}
|
|
@@ -3,7 +3,9 @@ function layoutDiv() {
|
|
|
3
3
|
var el = '';
|
|
4
4
|
var repo;
|
|
5
5
|
var branch = 'main';
|
|
6
|
-
if (page.
|
|
6
|
+
if (page.repo) {
|
|
7
|
+
repo = page.repo
|
|
8
|
+
} else if (page.layout === 'wiki' && page.wiki) {
|
|
7
9
|
let proj = theme.wiki.projects[page.wiki];
|
|
8
10
|
if (proj && proj.repo) {
|
|
9
11
|
repo = proj.repo;
|
|
@@ -11,9 +13,6 @@ function layoutDiv() {
|
|
|
11
13
|
branch = proj.branch;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
|
-
} else {
|
|
15
|
-
// 其它的如果有设置 repo 也可以
|
|
16
|
-
repo = page.repo;
|
|
17
16
|
}
|
|
18
17
|
if (repo == undefined) {
|
|
19
18
|
return el;
|
|
@@ -3,7 +3,9 @@ function layoutDiv() {
|
|
|
3
3
|
var el = '';
|
|
4
4
|
var repo;
|
|
5
5
|
var branch = 'main';
|
|
6
|
-
if (page.
|
|
6
|
+
if (page.repo) {
|
|
7
|
+
repo = page.repo
|
|
8
|
+
} else if (page.layout === 'wiki' && page.wiki) {
|
|
7
9
|
let proj = theme.wiki.projects[page.wiki];
|
|
8
10
|
if (proj && proj.repo) {
|
|
9
11
|
repo = proj.repo;
|
|
@@ -11,9 +13,6 @@ function layoutDiv() {
|
|
|
11
13
|
branch = proj.branch;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
|
-
} else {
|
|
15
|
-
// 其它的如果有设置 repo 也可以
|
|
16
|
-
repo = page.repo;
|
|
17
16
|
}
|
|
18
17
|
if (repo == undefined) {
|
|
19
18
|
return el;
|
|
@@ -24,7 +24,7 @@ function layoutDiv() {
|
|
|
24
24
|
|
|
25
25
|
el += '<div class="widget-wrap" id="github-user">';
|
|
26
26
|
// body
|
|
27
|
-
el += '<div class="widget-body stellar-ghinfo-api" api="' +
|
|
27
|
+
el += '<div class="widget-body stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/users/' + item.username + '">';
|
|
28
28
|
if (item.avatar) {
|
|
29
29
|
el += '<div class="avatar" ><img no-lazy type="img" id="avatar_url" src="' + config.avatar + '"></div>';
|
|
30
30
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutDiv() {
|
|
3
|
+
if (!item.content?.length) return ''
|
|
3
4
|
var el = '';
|
|
4
|
-
if (item.content == undefined || item.content.length == 0) {
|
|
5
|
-
return el;
|
|
6
|
-
}
|
|
7
5
|
el += '<div class="widget-wrap" id="markdown">';
|
|
6
|
+
if (item.title?.length > 0) {
|
|
8
7
|
el += '<div class="widget-header cap theme dis-select">';
|
|
9
|
-
|
|
10
|
-
el += '</div>';
|
|
11
|
-
el += '<div class="widget-body fs14">';
|
|
12
|
-
el += markdown(item.content);
|
|
8
|
+
el += '<span class="name">' + item.title + '</span>';
|
|
13
9
|
el += '</div>';
|
|
10
|
+
}
|
|
11
|
+
el += '<div class="widget-body fs14">';
|
|
12
|
+
el += markdown(item.content);
|
|
13
|
+
el += '</div>';
|
|
14
14
|
el += '</div>';
|
|
15
15
|
return el;
|
|
16
16
|
}
|
|
@@ -28,6 +28,7 @@ function layoutDiv() {
|
|
|
28
28
|
el += '<div class="widget-body related-posts fs14">';
|
|
29
29
|
arr.length = item.limit
|
|
30
30
|
arr.forEach(post => {
|
|
31
|
+
if (!post) { return }
|
|
31
32
|
el += '<a class="item title" href="' + url_for(post.link || post.path) + '">';
|
|
32
33
|
el += '<span class="title">'
|
|
33
34
|
if (post.layout == 'wiki') {
|
package/layout/archive.ejs
CHANGED
|
@@ -7,7 +7,7 @@ if (page.menu_id == undefined) {
|
|
|
7
7
|
<% if (page.posts && (is_category() || is_tag())) { %>
|
|
8
8
|
<%- partial('index') %>
|
|
9
9
|
<% } else { %>
|
|
10
|
-
<% page.title = __('btn.archives')
|
|
10
|
+
<% page.title = __('btn.archives'); %>
|
|
11
11
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
12
12
|
<div class='post-list'>
|
|
13
13
|
<% var years = []; %>
|
package/layout/categories.ejs
CHANGED
|
@@ -5,7 +5,7 @@ if (page.menu_id == undefined) {
|
|
|
5
5
|
}
|
|
6
6
|
%>
|
|
7
7
|
<% if (site.categories.length) { %>
|
|
8
|
-
<% page.title = __('btn.categories')
|
|
8
|
+
<% page.title = __('btn.categories'); %>
|
|
9
9
|
<% page.layout = 'categories'; %>
|
|
10
10
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
11
11
|
<div class='post-list'>
|
package/layout/tags.ejs
CHANGED
|
@@ -5,7 +5,7 @@ if (page.menu_id == undefined) {
|
|
|
5
5
|
}
|
|
6
6
|
%>
|
|
7
7
|
<% if (site.tags.length) { %>
|
|
8
|
-
<% page.title = __('btn.tags')
|
|
8
|
+
<% page.title = __('btn.tags'); %>
|
|
9
9
|
<% page.layout = 'tags'; %>
|
|
10
10
|
<%- partial('_partial/main/navbar/list_post') %>
|
|
11
11
|
<div class='post-list'>
|
package/layout/wiki.ejs
CHANGED
|
@@ -7,9 +7,9 @@ if (page.layout == undefined) {
|
|
|
7
7
|
}
|
|
8
8
|
if (page.title == undefined) {
|
|
9
9
|
if (page.tagName) {
|
|
10
|
-
page.title = page.tagName
|
|
10
|
+
page.title = page.tagName;
|
|
11
11
|
} else {
|
|
12
|
-
page.title = __('btn.wiki')
|
|
12
|
+
page.title = __('btn.wiki');
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
function layoutTitle() {
|
package/package.json
CHANGED
package/scripts/tags/mark.js
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
hexo.extend.tag.register('mark', function(args) {
|
|
12
12
|
args = hexo.args.map(args, ['color'], ['text']);
|
|
13
|
+
if (args.color == null) {
|
|
14
|
+
args.color = hexo.theme.config.tag_plugins.mark.default_color
|
|
15
|
+
}
|
|
13
16
|
var el = '';
|
|
14
17
|
el += '<mark class="tag-plugin mark"';
|
|
15
18
|
el += ' ' + hexo.args.joinTags(args, ['color']).join(' ');
|
|
@@ -66,13 +66,13 @@ set_text_black()
|
|
|
66
66
|
--theme-bg: #333
|
|
67
67
|
set_text_white()
|
|
68
68
|
|
|
69
|
-
.tag-plugin
|
|
69
|
+
.tag-plugin[color='warning']
|
|
70
70
|
--theme: $c-yellow
|
|
71
71
|
--theme-border: #ffe659
|
|
72
72
|
--theme-bg: #ffe659
|
|
73
73
|
--theme-link: #ff453a
|
|
74
74
|
|
|
75
|
-
.tag-plugin
|
|
75
|
+
.tag-plugin[color='error']
|
|
76
76
|
--theme: $c-yellow
|
|
77
77
|
--theme-border: #ff453a
|
|
78
78
|
--theme-bg: #ff453a
|