hexo-theme-stellar 1.14.0 → 1.15.0
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/README.md +3 -0
- package/_config.yml +6 -1
- package/layout/_partial/head.ejs +23 -12
- package/layout/_partial/main/article/article_footer.ejs +2 -2
- package/layout/_partial/main/article/read_next.ejs +2 -2
- package/layout/_partial/main/post_list/wiki_card.ejs +1 -1
- package/layout/_partial/sidebar/logo.ejs +2 -2
- package/layout/_partial/sidebar/widgets/ghissues.ejs +1 -1
- package/layout/_partial/sidebar/widgets/ghrepo.ejs +2 -2
- package/package.json +3 -3
- package/scripts/tags/friends.js +1 -1
- package/scripts/tags/sites.js +1 -1
- package/source/css/_common/highlight.styl +17 -1
- package/source/css/_layout/tag-plugins/timeline.styl +4 -4
- package/source/js/plugins/linkcard.js +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Stellar 是一个内置文档系统的简约商务风 Hexo 主题,支持丰富的标签和动态数据组件,请配合 [文档](https://xaoxuu.com/wiki/stellar/) 使用。
|
|
4
4
|
|
|
5
|
+
[](https://star-history.com/#xaoxuu/hexo-theme-stellar&Date)
|
|
6
|
+
|
|
7
|
+
|
|
5
8
|
## Getting Started
|
|
6
9
|
|
|
7
10
|
Check your environment:
|
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.15.0'
|
|
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
|
|
@@ -350,3 +350,8 @@ default:
|
|
|
350
350
|
link: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg
|
|
351
351
|
cover: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg
|
|
352
352
|
image: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg
|
|
353
|
+
|
|
354
|
+
api_host:
|
|
355
|
+
ghapi: https://api.github.com
|
|
356
|
+
ghraw: https://raw.githubusercontent.com
|
|
357
|
+
gist: https://gist.github.com
|
package/layout/_partial/head.ejs
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function generate_title() {
|
|
3
|
-
if (page.
|
|
4
|
-
return page.
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
if (page.seo_title) {
|
|
4
|
+
return page.seo_title;
|
|
5
|
+
}
|
|
6
|
+
if (page.wiki) {
|
|
7
|
+
let proj = theme.wiki.projects[page.wiki];
|
|
8
|
+
let wiki = (proj && proj.name) || page.wiki;
|
|
9
|
+
if (page.title) {
|
|
10
|
+
return wiki + __('symbol.colon') + page.title + ' - ' + config.title;
|
|
11
|
+
} else {
|
|
12
|
+
return wiki + ' - ' + config.title;
|
|
13
|
+
}
|
|
11
14
|
} else {
|
|
12
|
-
|
|
15
|
+
if (page.category) {
|
|
16
|
+
return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title;
|
|
17
|
+
} else if (page.tag) {
|
|
18
|
+
return __('btn.tag') + __('symbol.colon') + page.tag + ' - ' + config.title;
|
|
19
|
+
} else {
|
|
20
|
+
return config.title;
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
return '';
|
|
15
24
|
}
|
|
16
25
|
function generate_description() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
if (page.layout == 'wiki' && page.wiki) {
|
|
27
|
+
let proj = theme.wiki.projects[page.wiki];
|
|
28
|
+
if (proj && proj.description) {
|
|
29
|
+
return '<meta name="description" content="' + proj.description + '">';
|
|
30
|
+
}
|
|
20
31
|
}
|
|
21
32
|
if (page.description || page.excerpt || page.content) {
|
|
22
33
|
return '<meta name="description" content="' + truncate(strip_html(page.description || page.excerpt || page.content), {length: 150}) + '">';
|
|
@@ -69,7 +69,7 @@ function layoutDiv() {
|
|
|
69
69
|
el += ' onclick="util.toggle("qrcode-wechat")"';
|
|
70
70
|
} else if (item == 'weibo') {
|
|
71
71
|
el += ' href="https://service.weibo.com/share/share.php?url=' + page.permalink;
|
|
72
|
-
el += '&title=' + (page.seo_title || page.title
|
|
72
|
+
el += '&title=' + (page.seo_title || (page.title + ' - ' + config.title));
|
|
73
73
|
if (page.latyout == 'post' && page.cover) {
|
|
74
74
|
el += '&pics=' + page.cover;
|
|
75
75
|
} else if (page.latyout == 'wiki' && page.logo && page.logo.src) {
|
|
@@ -78,7 +78,7 @@ function layoutDiv() {
|
|
|
78
78
|
el += '&summary=' + truncate(page.description || strip_html(page.excerpt || page.content), {length: 120});
|
|
79
79
|
el += '"';
|
|
80
80
|
} else if (item == 'email') {
|
|
81
|
-
el += ' href="mailto:?subject=' + (page.title
|
|
81
|
+
el += ' href="mailto:?subject=' + ((page.title + ' - ' + config.title) || page.seo_title) + '&'
|
|
82
82
|
el += 'body=' + page.permalink + '"';
|
|
83
83
|
} else if (item == 'link') {
|
|
84
84
|
el += ' onclick="util.copy("copy-link", "' + __('message.copied') + '")"';
|
|
@@ -35,7 +35,7 @@ function layoutDiv() {
|
|
|
35
35
|
if (prev) {
|
|
36
36
|
el += '<div class="note">' + title_prev + '</div>';
|
|
37
37
|
el += '<a href="' + url_for(prev.path) + '">';
|
|
38
|
-
el += prev.title || prev.seo_title || prev.wiki;
|
|
38
|
+
el += prev.title || prev.seo_title || prev.wiki || date(prev.date, config.date_format);
|
|
39
39
|
el += '</a>';
|
|
40
40
|
}
|
|
41
41
|
el += '</div>';
|
|
@@ -44,7 +44,7 @@ function layoutDiv() {
|
|
|
44
44
|
if (next) {
|
|
45
45
|
el += '<div class="note">' + title_next + '</div>';
|
|
46
46
|
el += '<a href="' + url_for(next.path) + '">';
|
|
47
|
-
el += next.title || next.seo_title || next.wiki;
|
|
47
|
+
el += next.title || next.seo_title || next.wiki || date(next.date, config.date_format);
|
|
48
48
|
el += '</a>';
|
|
49
49
|
}
|
|
50
50
|
el += '</div>';
|
|
@@ -16,7 +16,7 @@ function layoutDiv() {
|
|
|
16
16
|
let tag = proj.tags[0];
|
|
17
17
|
el += '<div class="cap breadcrumb"' + category_color(tag) + '>' + tag + '</div>';
|
|
18
18
|
}
|
|
19
|
-
el += '<h2 class="post-title">' + (proj.title || proj.name
|
|
19
|
+
el += '<h2 class="post-title">' + (proj.title || proj.name) + '</h2>';
|
|
20
20
|
if (proj.description) {
|
|
21
21
|
el += '<p>' + proj.description + '</p>';
|
|
22
22
|
}
|
|
@@ -21,7 +21,7 @@ function layoutTitle(main, url, sub) {
|
|
|
21
21
|
}
|
|
22
22
|
function layoutDiv() {
|
|
23
23
|
var el = '';
|
|
24
|
-
if (page.layout == 'wiki') {
|
|
24
|
+
if (page.layout == 'wiki' && proj && proj.index != false) {
|
|
25
25
|
el += '<div class="logo-wrap wiki">';
|
|
26
26
|
// all products
|
|
27
27
|
el += '<a style="filter: grayscale(100%)" class="wiki-home cap" href="' + url_for(config.wiki_dir) + '">';
|
|
@@ -39,7 +39,7 @@ function layoutDiv() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
if (proj != undefined) {
|
|
42
|
-
let main = proj.name || proj.title ||
|
|
42
|
+
let main = proj.name || proj.title || page.wiki || page.title;
|
|
43
43
|
let url = proj.homepage.path;
|
|
44
44
|
let sub = proj.subtitle;
|
|
45
45
|
el += layoutTitle(main, url, sub);
|
|
@@ -18,7 +18,7 @@ function layoutDiv() {
|
|
|
18
18
|
if (repo == undefined) {
|
|
19
19
|
return el;
|
|
20
20
|
}
|
|
21
|
-
item.api =
|
|
21
|
+
item.api = theme.api_host.ghapi + '/repos/' + repo + '/issues?per_page=' + item.limit;
|
|
22
22
|
if (item.labels) {
|
|
23
23
|
item.api += '&labels=' + item.labels;
|
|
24
24
|
}
|
|
@@ -22,7 +22,7 @@ function layoutDiv() {
|
|
|
22
22
|
el += '<div class="widget-wrap" id="repo-info">';
|
|
23
23
|
// body
|
|
24
24
|
el += '<div class="widget-body">';
|
|
25
|
-
el += '<div class="items stellar-ghinfo-api" api="
|
|
25
|
+
el += '<div class="items stellar-ghinfo-api" api="' + theme.api_host.ghapi + '/repos/' + repo + '">';
|
|
26
26
|
el += '<a class="repo" href="https://github.com/' + repo + '" target="_blank" rel="external nofollow noopener noreferrer">';
|
|
27
27
|
el += '<div class="repo-name flex-row">';
|
|
28
28
|
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg>';
|
|
@@ -38,7 +38,7 @@ function layoutDiv() {
|
|
|
38
38
|
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg>';
|
|
39
39
|
el += '<span type="text" id="forks_count"></span>';
|
|
40
40
|
el += '</div>';
|
|
41
|
-
el += '<div class="flex-row stellar-ghinfo-api" index="0" api="
|
|
41
|
+
el += '<div class="flex-row stellar-ghinfo-api" index="0" api="' + theme.api_host.ghapi + '/repos/' + repo + '/tags">';
|
|
42
42
|
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1em" height="1em" fill="currentColor" style="user-select:none;overflow:visible"><path fill-rule="evenodd" d="M2.5 7.775V2.75a.25.25 0 01.25-.25h5.025a.25.25 0 01.177.073l6.25 6.25a.25.25 0 010 .354l-5.025 5.025a.25.25 0 01-.354 0l-6.25-6.25a.25.25 0 01-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 010 2.474l-5.026 5.026a1.75 1.75 0 01-2.474 0l-6.25-6.25A1.75 1.75 0 011 7.775zM6 5a1 1 0 100 2 1 1 0 000-2z"></path></svg>';
|
|
43
43
|
el += '<span type="text" id="latest-tag-name">0</span>';
|
|
44
44
|
el += '</div>';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-theme-stellar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Elegant and powerful theme for Hexo.",
|
|
5
5
|
"main": "package.json",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"url": "https://github.com/xaoxuu/hexo-theme-stellar/issues/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"hexo-renderer-ejs": "^
|
|
25
|
-
"hexo-renderer-stylus": "^2.0
|
|
24
|
+
"hexo-renderer-ejs": "^2.0.0",
|
|
25
|
+
"hexo-renderer-stylus": "^2.1.0"
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://xaoxuu.com/wiki/stellar/",
|
|
28
28
|
"devDependencies": {
|
package/scripts/tags/friends.js
CHANGED
|
@@ -17,7 +17,7 @@ hexo.extend.tag.register('friends', function(args) {
|
|
|
17
17
|
if (args.api) {
|
|
18
18
|
api = args.api;
|
|
19
19
|
} else if (args.repo) {
|
|
20
|
-
api = 'https://
|
|
20
|
+
api = 'https://api.vlts.cc/output_data/v2/' + args.repo;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
var el = '<div class="tag-plugin users-wrap">';
|
package/scripts/tags/sites.js
CHANGED
|
@@ -17,7 +17,7 @@ hexo.extend.tag.register('sites', function(args) {
|
|
|
17
17
|
if (args.api) {
|
|
18
18
|
api = args.api;
|
|
19
19
|
} else if (args.repo) {
|
|
20
|
-
api = 'https://
|
|
20
|
+
api = 'https://api.vlts.cc/output_data/v2/' + args.repo;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
var el = '<div class="tag-plugin sites-wrap">';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
code
|
|
2
2
|
-webkit-font-smoothing: auto
|
|
3
3
|
-moz-osx-font-smoothing: auto
|
|
4
|
-
color: var(--text-code)
|
|
5
4
|
font-family: $ff-code
|
|
6
5
|
|
|
7
6
|
p>code:not([class]),li>code:not([class])
|
|
@@ -9,6 +8,7 @@ p>code:not([class]),li>code:not([class])
|
|
|
9
8
|
background: var(--block)
|
|
10
9
|
padding: .2em
|
|
11
10
|
border-radius: 4px
|
|
11
|
+
color: var(--text-code)
|
|
12
12
|
|
|
13
13
|
article.md .highlight, pre:not([class]):has(>code)
|
|
14
14
|
margin: var(--gap-p) 0
|
|
@@ -75,6 +75,22 @@ article.md .highlight
|
|
|
75
75
|
.gutter+.code pre
|
|
76
76
|
padding-left: 0.25em
|
|
77
77
|
|
|
78
|
+
article.md .gist
|
|
79
|
+
.gist-file
|
|
80
|
+
border: 1px solid var(--block-border)
|
|
81
|
+
border-radius: $border-block
|
|
82
|
+
.gist-data
|
|
83
|
+
border-bottom: 1px solid var(--block-border)
|
|
84
|
+
.highlight
|
|
85
|
+
display: inherit
|
|
86
|
+
border: none
|
|
87
|
+
border-radius: 0
|
|
88
|
+
background: none
|
|
89
|
+
margin: 0
|
|
90
|
+
padding: 1em 0
|
|
91
|
+
.gist-meta
|
|
92
|
+
background: var(--block-border)
|
|
93
|
+
|
|
78
94
|
|
|
79
95
|
table:not([class])
|
|
80
96
|
border-collapse: collapse
|
|
@@ -104,6 +104,10 @@
|
|
|
104
104
|
padding: 0.5rem 1rem
|
|
105
105
|
margin-top: 4px
|
|
106
106
|
box-shadow: $boxshadow-block
|
|
107
|
+
trans2: transform box-shadow
|
|
108
|
+
&:hover
|
|
109
|
+
transform: translateY(-1px)
|
|
110
|
+
box-shadow: $boxshadow-card-float
|
|
107
111
|
p
|
|
108
112
|
font-size: $fs-14
|
|
109
113
|
img
|
|
@@ -124,12 +128,8 @@
|
|
|
124
128
|
a.body
|
|
125
129
|
display: block
|
|
126
130
|
color: var(--text-p1)
|
|
127
|
-
trans2: transform box-shadow
|
|
128
131
|
line-height: 1.25
|
|
129
132
|
padding: 0.75rem 1rem
|
|
130
|
-
&:hover
|
|
131
|
-
transform: translateY(-1px)
|
|
132
|
-
box-shadow: $boxshadow-card-float
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
.tag-plugin.timeline[api] .body
|
|
@@ -33,7 +33,7 @@ function setCardLink(nodes) {
|
|
|
33
33
|
if (el.nodeType !== 1) return
|
|
34
34
|
el.removeAttribute('cardlink');
|
|
35
35
|
const link = el.href;
|
|
36
|
-
const api = 'https://
|
|
36
|
+
const api = 'https://api.vlts.cc/site_info/v1?url=';
|
|
37
37
|
fetch(api + link).then(function(response) {
|
|
38
38
|
if (response.ok) {
|
|
39
39
|
return response.json();
|