hexo-theme-stellar 1.12.0 → 1.13.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 +7 -7
- package/_config.yml +8 -26
- package/_data/links.yml +7 -0
- package/_data/widgets.yml +1 -1
- package/layout/_partial/head.ejs +2 -0
- package/layout/_partial/main/navbar/list_post.ejs +57 -34
- package/layout/_partial/main/post_list/post_card.ejs +5 -1
- package/layout/_partial/scripts/index.ejs +1 -0
- package/layout/_partial/sidebar/widgets/ghissues.ejs +0 -1
- package/layout/_partial/sidebar/widgets/timeline.ejs +1 -1
- package/layout/page.ejs +19 -10
- package/package.json +1 -1
- package/scripts/events/lib/config.js +1 -1
- package/scripts/tags/friends.js +36 -75
- package/scripts/tags/sites.js +40 -79
- package/scripts/tags/timeline.js +6 -4
- package/source/css/_layout/list.styl +2 -5
- package/source/css/_layout/main.styl +1 -1
- package/source/css/_layout/md.styl +0 -3
- package/source/css/_layout/partial/navbar.styl +1 -1
- package/source/css/_layout/sidebar/sidebar.styl +10 -9
- package/source/css/_layout/sidebar/widgets.styl +1 -2
- package/source/css/_layout/tag-plugins/split.styl +10 -6
- package/source/css/_layout/tag-plugins/timeline.styl +22 -5
- package/source/css/_plugins/comments/waline.styl +4 -0
- package/source/css/_plugins/index.styl +0 -2
- package/source/js/main.js +1 -1
- package/source/js/plugins/fcircle.js +92 -0
- package/source/js/plugins/timeline.js +47 -34
- package/layout/_partial/plugins/comments/valine/layout.ejs +0 -19
- package/layout/_partial/plugins/comments/valine/script.ejs +0 -48
- package/scripts/tags/issues.js +0 -30
- package/source/css/_plugins/comments/valine.styl +0 -222
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Stellar - 每个人的独立博客
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Stellar 是一个内置文档系统的简约商务风 Hexo 主题,支持丰富的标签和动态数据组件,请配合 [文档](https://xaoxuu.com/wiki/stellar/) 使用。
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
Check your environment:
|
|
8
8
|
|
|
9
9
|
```yaml
|
|
10
|
-
Hexo: 5.4.0
|
|
11
|
-
hexo-cli: 4.3.0
|
|
12
|
-
node.js: 14.17.3
|
|
13
|
-
npm: 6.14.13
|
|
10
|
+
Hexo: 5.4.0 ~ 6.3.0
|
|
11
|
+
hexo-cli: 4.3.0 ~ latest
|
|
12
|
+
node.js: 14.17.3 ~ 18.12.0
|
|
13
|
+
npm: 6.14.13 ~ 8.19.2
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Edit your `_config.yml`:
|
|
@@ -31,7 +31,7 @@ See docs: https://xaoxuu.com/wiki/stellar/
|
|
|
31
31
|
|
|
32
32
|
## Examples
|
|
33
33
|
|
|
34
|
-
https://xaoxuu.com
|
|
34
|
+
https://xaoxuu.com/wiki/stellar/examples/
|
|
35
35
|
|
|
36
36
|
## Feedback
|
|
37
37
|
|
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.13.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
|
|
@@ -30,6 +30,10 @@ sidebar:
|
|
|
30
30
|
post: [toc, ghrepo, ghissues] # for pages using 'layout:post'
|
|
31
31
|
wiki: [toc, ghrepo, ghissues, related] # for pages using 'layout:wiki'
|
|
32
32
|
|
|
33
|
+
######## Index ########
|
|
34
|
+
post-index: # 近期发布 分类 标签 归档 and ...
|
|
35
|
+
# '朋友文章': /friends/rss/
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
######## Main ########
|
|
35
39
|
breadcrumb:
|
|
@@ -59,7 +63,7 @@ article:
|
|
|
59
63
|
|
|
60
64
|
######## Comments ########
|
|
61
65
|
comments:
|
|
62
|
-
service: # beaudar, utterances,
|
|
66
|
+
service: # beaudar, utterances, twikoo, waline
|
|
63
67
|
# beaudar
|
|
64
68
|
# https://beaudar.lipk.org/
|
|
65
69
|
beaudar:
|
|
@@ -98,28 +102,6 @@ comments:
|
|
|
98
102
|
data-loading: lazy
|
|
99
103
|
crossorigin: anonymous
|
|
100
104
|
|
|
101
|
-
valine:
|
|
102
|
-
js: https://fastly.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js
|
|
103
|
-
appId: # your appId
|
|
104
|
-
appKey: # your appKey
|
|
105
|
-
placeholder:
|
|
106
|
-
requiredFields: [nick, mail]
|
|
107
|
-
enableQQ: true # Unstable avatar link
|
|
108
|
-
recordIP: false # Record commenter IP
|
|
109
|
-
avatar: robohash # gravatar style https://valine.js.org/avatar
|
|
110
|
-
pageSize: 10 # comment list page size
|
|
111
|
-
lang: zh-cn
|
|
112
|
-
highlight: true
|
|
113
|
-
mathJax: false
|
|
114
|
-
tagMeta: [博主, 小伙伴, 访客] # 标签要显示的文字,默认'博主,小伙伴,访客'
|
|
115
|
-
metaPlaceholder:
|
|
116
|
-
nick: "昵称/QQ号(必填)"
|
|
117
|
-
mail: "邮箱(必填,完全保密)"
|
|
118
|
-
link: "网址(https://)"
|
|
119
|
-
master: #md5加密后的博主邮箱
|
|
120
|
-
- 6783037F2DF30EAB99F9FC256157D875
|
|
121
|
-
friends: #md5加密后的小伙伴邮箱
|
|
122
|
-
- 6783037F2DF30EAB99F9FC256157D875
|
|
123
105
|
# Twikoo
|
|
124
106
|
# https://twikoo.js.org/
|
|
125
107
|
twikoo:
|
|
@@ -251,9 +233,10 @@ plugins:
|
|
|
251
233
|
ghinfo: /js/plugins/ghinfo.js
|
|
252
234
|
timeline: /js/plugins/timeline.js
|
|
253
235
|
linkcard: /js/plugins/linkcard.js
|
|
236
|
+
fcircle: /js/plugins/fcircle.js
|
|
254
237
|
|
|
255
238
|
marked: https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js
|
|
256
|
-
|
|
239
|
+
|
|
257
240
|
## optional plugins ##
|
|
258
241
|
# preload
|
|
259
242
|
preload:
|
|
@@ -285,7 +268,6 @@ plugins:
|
|
|
285
268
|
js: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js
|
|
286
269
|
css: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css
|
|
287
270
|
# 可以处理评论区的图片(不支持 iframe 类评论系统)例如:
|
|
288
|
-
# 使用valine评论可以写: .vcontent img:not(.vemoji)
|
|
289
271
|
# 使用twikoo评论可以写: .tk-content img:not([class*="emo"])
|
|
290
272
|
# 使用waline评论可以写: #waline_container .vcontent img
|
|
291
273
|
selector: .swiper-slide img # 多个选择器用英文逗号隔开
|
package/_data/links.yml
ADDED
package/_data/widgets.yml
CHANGED
package/layout/_partial/head.ejs
CHANGED
|
@@ -45,6 +45,7 @@ function og_args() {
|
|
|
45
45
|
%>
|
|
46
46
|
<head>
|
|
47
47
|
<%- meta_generator() %>
|
|
48
|
+
<meta name="hexo-theme" content="<%- stellar_info('tree') %>">
|
|
48
49
|
<meta charset="utf-8">
|
|
49
50
|
<%- generate_robots() %>
|
|
50
51
|
|
|
@@ -60,6 +61,7 @@ function og_args() {
|
|
|
60
61
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
61
62
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
62
63
|
<meta name="theme-color" content="#f8f8f8">
|
|
64
|
+
|
|
63
65
|
<title><%- generate_title() %></title>
|
|
64
66
|
|
|
65
67
|
<% if (theme.open_graph && theme.open_graph.enable) { %>
|
|
@@ -1,34 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = '';
|
|
4
|
+
el += '<div class="nav-wrap">';
|
|
5
|
+
el += '<nav class="sub post cap">';
|
|
6
|
+
if (is_home()) {
|
|
7
|
+
el += '<a class="active" href="' + url_for("/") + '">' + __("btn.recent_publish") + '</a>';
|
|
8
|
+
} else {
|
|
9
|
+
el += '<a href="' + url_for("/") + '">' + __("btn.recent_publish") + '</a>';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (site.categories && site.categories.length > 0) {
|
|
13
|
+
if (page.category) {
|
|
14
|
+
el += '<a class="active" href="' + url_for(config.category_dir) + '">' + __("btn.category") + __("symbol.colon") + page.category + '</a>';
|
|
15
|
+
} else if (page.layout == "categories") {
|
|
16
|
+
el += '<a class="active" href="' + url_for(config.category_dir) + '">' + __("btn.categories") + '</a>';
|
|
17
|
+
} else {
|
|
18
|
+
el += '<a href="' + url_for(config.category_dir) + '">' + __("btn.categories") + '</a>';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (site.tags && site.tags.length > 0) {
|
|
23
|
+
if (page.tag) {
|
|
24
|
+
el += '<a class="active" href="' + url_for(config.tag_dir) + '">' + __("btn.tag") + __("symbol.colon") + page.tag + '</a>';
|
|
25
|
+
} else if (page.layout == "tags") {
|
|
26
|
+
el += '<a class="active" href="' + url_for(config.tag_dir) + '">' + __("btn.tags") + '</a>';
|
|
27
|
+
} else {
|
|
28
|
+
el += '<a href="' + url_for(config.tag_dir) + '">' + __("btn.tags") + '</a>';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (site.posts && site.posts.length > 0) {
|
|
33
|
+
if (is_archive()) {
|
|
34
|
+
el += '<a class="active" href="' + url_for(config.archive_dir) + '">' + __("btn.archives") + '</a>';
|
|
35
|
+
} else {
|
|
36
|
+
el += '<a href="' + url_for(config.archive_dir) + '">' + __("btn.archives") + '</a>';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (theme['post-index']) {
|
|
41
|
+
const obj = theme['post-index'];
|
|
42
|
+
for (let key of Object.keys(obj)) {
|
|
43
|
+
if (full_url_for(page.path) == full_url_for(obj[key])) {
|
|
44
|
+
el += '<a class="active" href="' + url_for(obj[key]) + '">' + key + '</a>';
|
|
45
|
+
} else {
|
|
46
|
+
el += '<a href="' + url_for(obj[key]) + '">' + key + '</a>';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
el += '</nav>';
|
|
52
|
+
el += '</div>';
|
|
53
|
+
return el;
|
|
54
|
+
}
|
|
55
|
+
%>
|
|
56
|
+
|
|
57
|
+
<%- layoutDiv() %>
|
|
@@ -3,7 +3,8 @@ const obj = {
|
|
|
3
3
|
image: post['cover'],
|
|
4
4
|
title: post['cover-title'],
|
|
5
5
|
cat: post['cover-cat'],
|
|
6
|
-
subtitle: post['cover-subtitle']
|
|
6
|
+
subtitle: post['cover-subtitle'],
|
|
7
|
+
color: post['cover-text-color']
|
|
7
8
|
};
|
|
8
9
|
function div_default() {
|
|
9
10
|
var el = '';
|
|
@@ -98,6 +99,9 @@ function div_photo() {
|
|
|
98
99
|
el += '<img src="' + obj.image + '"/>';
|
|
99
100
|
if (obj.title || obj.cat || obj.subtitle) {
|
|
100
101
|
el += '<div class="cover-info"';
|
|
102
|
+
if (obj.color) {
|
|
103
|
+
el += 'style="color:' + obj.color + '"';
|
|
104
|
+
}
|
|
101
105
|
if (obj.cat) {
|
|
102
106
|
el += 'position="top">';
|
|
103
107
|
} else {
|
|
@@ -12,7 +12,7 @@ function layoutDiv() {
|
|
|
12
12
|
}
|
|
13
13
|
el += '<div class="widget-body fs14">';
|
|
14
14
|
el += '<div class="tag-plugin timeline stellar-timeline-api"';
|
|
15
|
-
['api', 'user'].forEach(key => {
|
|
15
|
+
['api', 'user', 'hide'].forEach(key => {
|
|
16
16
|
if (item[key]) {
|
|
17
17
|
el += ' ' + key + '="' + item[key] + '"';
|
|
18
18
|
}
|
package/layout/page.ejs
CHANGED
|
@@ -7,14 +7,23 @@ function layoutTitle() {
|
|
|
7
7
|
return '';
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
+
function layoutDiv() {
|
|
11
|
+
var el = '';
|
|
12
|
+
if (page.post_list) {
|
|
13
|
+
el += partial('_partial/main/navbar/list_post');
|
|
14
|
+
}
|
|
15
|
+
if (page.h1 || page.title || (page.content && page.content.length > 0)) {
|
|
16
|
+
el += partial('_partial/main/navbar/breadcrumb');
|
|
17
|
+
}
|
|
18
|
+
el += '<article class="content md ' + page.layout + (page.indent ? ' indent' : '') + scrollreveal() + '">';
|
|
19
|
+
el += layoutTitle();
|
|
20
|
+
if (page.content && page.content.length > 0) {
|
|
21
|
+
el += page.content;
|
|
22
|
+
}
|
|
23
|
+
el += '</article>';
|
|
24
|
+
el += partial('_partial/plugins/comments/layout');
|
|
25
|
+
return el;
|
|
26
|
+
}
|
|
10
27
|
%>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<article class='content md <%- page.layout %><%- page.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
|
14
|
-
<%- layoutTitle() %>
|
|
15
|
-
<% if (page.content && page.content.length > 0) { %>
|
|
16
|
-
<%- page.content %>
|
|
17
|
-
<% } %>
|
|
18
|
-
</article>
|
|
19
|
-
<% } %>
|
|
20
|
-
<%- partial('_partial/plugins/comments/layout') %>
|
|
28
|
+
|
|
29
|
+
<%- layoutDiv() %>
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ module.exports = hexo => {
|
|
|
25
25
|
warning('caching', '`relative_link` option in Hexo `_config.yml`');
|
|
26
26
|
hexo.config.relative_link = false;
|
|
27
27
|
}
|
|
28
|
-
hexo.config.meta_generator = false;
|
|
28
|
+
// hexo.config.meta_generator = false;
|
|
29
29
|
|
|
30
30
|
// merge data
|
|
31
31
|
const data = hexo.locals.get('data');
|
package/scripts/tags/friends.js
CHANGED
|
@@ -1,92 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* friends.js
|
|
2
|
+
* friends.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* {% friends [
|
|
5
|
+
* {% friends [group] [repo:owner/repo] [api:http] %}
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
hexo.extend.tag.register('friends', function(args) {
|
|
11
|
-
args = hexo.args.map(args, ['
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
args = hexo.args.map(args, ['repo', 'api'], ['group']);
|
|
12
|
+
var links = hexo.locals.get('data').links;
|
|
13
|
+
if (links == undefined) {
|
|
14
|
+
links = {};
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
friends = {};
|
|
21
|
-
}
|
|
22
|
-
if (args.repo) {
|
|
23
|
-
friends = {
|
|
24
|
-
group: {
|
|
25
|
-
api: args.api,
|
|
26
|
-
repo: args.repo
|
|
27
|
-
}
|
|
28
|
-
}
|
|
16
|
+
var api;
|
|
17
|
+
if (args.api) {
|
|
18
|
+
api = args.api;
|
|
19
|
+
} else if (args.repo) {
|
|
20
|
+
api = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
|
|
29
21
|
}
|
|
22
|
+
|
|
30
23
|
var el = '<div class="tag-plugin users-wrap">';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
cell += '</a></div>'
|
|
49
|
-
return cell;
|
|
50
|
-
} else {
|
|
51
|
-
return '';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
for (let groupId of Object.keys(friends)) {
|
|
55
|
-
function f() {
|
|
56
|
-
if (args.not && args.not.includes(groupId)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (groupId in friends) {
|
|
60
|
-
let group = friends[groupId];
|
|
61
|
-
if ((typeof group == 'object') && group.constructor == Array) {
|
|
62
|
-
group = {items: group};
|
|
63
|
-
}
|
|
64
|
-
if (group.title || group.description) {
|
|
65
|
-
el += groupHeader(group);
|
|
66
|
-
}
|
|
67
|
-
if (group.repo) {
|
|
68
|
-
el += '<div class="stellar-friends-api"';
|
|
69
|
-
el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
|
|
70
|
-
el += '>';
|
|
71
|
-
el += '<div class="group-body"></div>';
|
|
72
|
-
el += '</div>';
|
|
73
|
-
} else if (group.items) {
|
|
74
|
-
el += '<div class="group-body">';
|
|
75
|
-
group.items.forEach((friend, i) => {
|
|
76
|
-
el += cell(friend);
|
|
77
|
-
});
|
|
78
|
-
el += '</div>';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
if (args.only) {
|
|
83
|
-
if (args.only.includes(groupId)) {
|
|
84
|
-
f();
|
|
24
|
+
if (api) {
|
|
25
|
+
el += '<div class="stellar-friends-api"';
|
|
26
|
+
el += ' api="' + api + '"';
|
|
27
|
+
el += '>';
|
|
28
|
+
el += '<div class="group-body"></div>';
|
|
29
|
+
el += '</div>';
|
|
30
|
+
} else if (args.group) {
|
|
31
|
+
function cell(item) {
|
|
32
|
+
if (item.url && item.title) {
|
|
33
|
+
var cell = '<div class="user-card">';
|
|
34
|
+
cell += '<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="' + item.url + '">';
|
|
35
|
+
cell += '<img src="' + (item.avatar || hexo.theme.config.default.avatar) + '" onerror="javascript:this.removeAttribute("data-src");this.src="' + hexo.theme.config.default.avatar + '";"/>';
|
|
36
|
+
cell += '<div class="name"><span>' + item.title + '</span></div>';
|
|
37
|
+
cell += '</a></div>'
|
|
38
|
+
return cell;
|
|
39
|
+
} else {
|
|
40
|
+
return '';
|
|
85
41
|
}
|
|
86
|
-
} else {
|
|
87
|
-
f();
|
|
88
42
|
}
|
|
43
|
+
el += '<div class="group-body">';
|
|
44
|
+
const items = links[args.group] || [];
|
|
45
|
+
items.forEach((item, i) => {
|
|
46
|
+
el += cell(item);
|
|
47
|
+
});
|
|
48
|
+
el += '</div>';
|
|
89
49
|
}
|
|
50
|
+
|
|
90
51
|
el += '</div>';
|
|
91
52
|
return el;
|
|
92
53
|
});
|
package/scripts/tags/sites.js
CHANGED
|
@@ -1,96 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* sites.js
|
|
2
|
+
* sites.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* {% sites [
|
|
5
|
+
* {% sites [group] [repo:owner/repo] [api:http] %}
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
hexo.extend.tag.register('sites', function(args) {
|
|
11
|
-
args = hexo.args.map(args, ['
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
args = hexo.args.map(args, ['repo', 'api'], ['group']);
|
|
12
|
+
var links = hexo.locals.get('data').links;
|
|
13
|
+
if (links == undefined) {
|
|
14
|
+
links = {};
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
sites = {};
|
|
21
|
-
}
|
|
22
|
-
if (args.repo) {
|
|
23
|
-
sites = {
|
|
24
|
-
group: {
|
|
25
|
-
api: args.api,
|
|
26
|
-
repo: args.repo
|
|
27
|
-
}
|
|
28
|
-
}
|
|
16
|
+
var api;
|
|
17
|
+
if (args.api) {
|
|
18
|
+
api = args.api;
|
|
19
|
+
} else if (args.repo) {
|
|
20
|
+
api = 'https://raw.github.xaoxuu.com/' + args.repo + '/output/v2/data.json';
|
|
29
21
|
}
|
|
22
|
+
|
|
30
23
|
var el = '<div class="tag-plugin sites-wrap">';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
cell += '</a></div>'
|
|
53
|
-
return cell;
|
|
54
|
-
} else {
|
|
55
|
-
return '';
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
for (let groupId of Object.keys(sites)) {
|
|
59
|
-
function f() {
|
|
60
|
-
if (args.not && args.not.includes(groupId)) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (groupId in sites) {
|
|
64
|
-
let group = sites[groupId];
|
|
65
|
-
if ((typeof group == 'object') && group.constructor == Array) {
|
|
66
|
-
group = {items: group};
|
|
67
|
-
}
|
|
68
|
-
if (group.title || group.description) {
|
|
69
|
-
el += groupHeader(group);
|
|
70
|
-
}
|
|
71
|
-
if (group.repo) {
|
|
72
|
-
el += '<div class="stellar-sites-api"';
|
|
73
|
-
el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
|
|
74
|
-
el += '>';
|
|
75
|
-
el += '<div class="group-body"></div>';
|
|
76
|
-
el += '</div>';
|
|
77
|
-
} else if (group.items) {
|
|
78
|
-
el += '<div class="group-body">';
|
|
79
|
-
group.items.forEach((site, i) => {
|
|
80
|
-
el += cell(site);
|
|
81
|
-
});
|
|
82
|
-
el += '</div>';
|
|
83
|
-
}
|
|
24
|
+
if (api) {
|
|
25
|
+
el += '<div class="stellar-sites-api"';
|
|
26
|
+
el += ' api="' + api + '"';
|
|
27
|
+
el += '>';
|
|
28
|
+
el += '<div class="group-body"></div>';
|
|
29
|
+
el += '</div>';
|
|
30
|
+
} else if (args.group) {
|
|
31
|
+
function cell(item) {
|
|
32
|
+
if (item.url && item.title) {
|
|
33
|
+
var cell = '<div class="site-card">';
|
|
34
|
+
cell += '<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="' + item.url + '">';
|
|
35
|
+
cell += '<img src="' + (item.screenshot || ('https://screenshot-api.xaoxuu.com/api?url=' + item.url + '&width=1280&height=720')) + '" onerror="javascript:this.removeAttribute("data-src");this.src="' + hexo.theme.config.default.cover + '";"/>';
|
|
36
|
+
cell += '<div class="info">';
|
|
37
|
+
cell += '<img src="' + (item.avatar || hexo.theme.config.default.link) + '" onerror="javascript:this.removeAttribute("data-src");this.src="' + hexo.theme.config.default.link + '";"/>';
|
|
38
|
+
cell += '<span class="title">' + item.title + '</span>';
|
|
39
|
+
cell += '<span class="desc">' + (item.description || item.url) + '</span>';
|
|
40
|
+
cell += '</div>';
|
|
41
|
+
cell += '</a></div>'
|
|
42
|
+
return cell;
|
|
43
|
+
} else {
|
|
44
|
+
return '';
|
|
84
45
|
}
|
|
85
46
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
}
|
|
47
|
+
el += '<div class="group-body">';
|
|
48
|
+
const items = links[args.group] || [];
|
|
49
|
+
items.forEach((item, i) => {
|
|
50
|
+
el += cell(item);
|
|
51
|
+
});
|
|
52
|
+
el += '</div>';
|
|
93
53
|
}
|
|
54
|
+
|
|
94
55
|
el += '</div>';
|
|
95
56
|
return el;
|
|
96
57
|
});
|
package/scripts/tags/timeline.js
CHANGED
|
@@ -36,12 +36,14 @@ function layoutNodeContent(content) {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
function postTimeline(args, content) {
|
|
39
|
-
args = hexo.args.map(args, ['api', 'user']);
|
|
39
|
+
args = hexo.args.map(args, ['api', 'user', 'type', 'limit', 'hide']);
|
|
40
40
|
var el = '';
|
|
41
|
-
|
|
41
|
+
if (!args.type) {
|
|
42
|
+
args.type = 'timeline';
|
|
43
|
+
}
|
|
42
44
|
if (args.api && args.api.length > 0) {
|
|
43
|
-
el += '<div class="tag-plugin timeline stellar-
|
|
44
|
-
el += ' ' + hexo.args.joinTags(args, ['api', 'user']).join(' ');
|
|
45
|
+
el += '<div class="tag-plugin timeline stellar-' + args.type + '-api"';
|
|
46
|
+
el += ' ' + hexo.args.joinTags(args, ['api', 'user', 'limit', 'hide']).join(' ');
|
|
45
47
|
el += '>';
|
|
46
48
|
} else {
|
|
47
49
|
el += '<div class="tag-plugin timeline">';
|