hexo-theme-stellar 1.18.0 → 1.18.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/README.md +2 -2
- package/_config.yml +32 -34
- package/layout/404.ejs +1 -1
- package/layout/_partial/cover/wiki_cover.ejs +1 -1
- package/layout/_partial/plugins/comments/artalk/layout.ejs +19 -0
- package/layout/_partial/plugins/comments/artalk/script.ejs +25 -0
- package/layout/_partial/plugins/comments/layout.ejs +4 -4
- package/layout/_partial/scripts/index.ejs +1 -1
- package/layout/_partial/widgets/toc.ejs +1 -1
- package/package.json +1 -1
- package/scripts/tags/index.js +32 -6
- package/scripts/tags/inline-labels.js +27 -27
- package/scripts/tags/lib/ablock.js +33 -0
- package/scripts/tags/lib/about.js +48 -0
- package/scripts/tags/lib/checkbox.js +30 -0
- package/scripts/tags/{copy.js → lib/copy.js} +23 -23
- package/scripts/tags/lib/emoji.js +40 -0
- package/scripts/tags/{folders.js → lib/folders.js} +22 -22
- package/scripts/tags/lib/folding.js +30 -0
- package/scripts/tags/lib/frame.js +66 -0
- package/scripts/tags/lib/friends.js +53 -0
- package/scripts/tags/{ghcard.js → lib/ghcard.js} +18 -18
- package/scripts/tags/{grid.js → lib/grid.js} +20 -20
- package/scripts/tags/{image.js → lib/image.js} +38 -38
- package/scripts/tags/lib/link.js +78 -0
- package/scripts/tags/lib/mark.js +23 -0
- package/scripts/tags/lib/navbar.js +57 -0
- package/scripts/tags/lib/note.js +35 -0
- package/scripts/tags/lib/poetry.js +47 -0
- package/scripts/tags/{quot.js → lib/quot.js} +24 -24
- package/scripts/tags/lib/sites.js +57 -0
- package/scripts/tags/lib/swiper.js +36 -0
- package/scripts/tags/lib/tabs.js +33 -33
- package/scripts/tags/{tag.js → lib/tag.js} +13 -13
- package/scripts/tags/lib/timeline.js +78 -0
- package/scripts/tags/lib/toc.js +73 -0
- package/source/css/_common/base.styl +2 -2
- package/source/css/_common/blockquote.styl +2 -2
- package/source/css/_common/button.styl +38 -2
- package/source/css/_common/highlight.styl +11 -10
- package/source/css/_custom.styl +17 -8
- package/source/css/_defines/func.styl +1 -1
- package/source/css/_defines/theme.styl +5 -7
- package/source/css/_layout/list.styl +0 -1
- package/source/css/_layout/md.styl +15 -13
- package/source/css/_layout/pages/archives.styl +1 -1
- package/source/css/_layout/pages/error.styl +0 -1
- package/source/css/_layout/partial/related.styl +8 -6
- package/source/css/_layout/sidebar/header.styl +1 -1
- package/source/css/_layout/sidebar/sidebar.styl +2 -1
- package/source/css/_layout/tag-plugins/checkbox.styl +3 -4
- package/source/css/_layout/tag-plugins/common.styl +6 -6
- package/source/css/_layout/tag-plugins/copy.styl +1 -1
- package/source/css/_layout/tag-plugins/folders.styl +9 -9
- package/source/css/_layout/tag-plugins/folding.styl +5 -4
- package/source/css/_layout/tag-plugins/grid.styl +4 -1
- package/source/css/_layout/tag-plugins/link.styl +1 -1
- package/source/css/_layout/tag-plugins/note.styl +9 -10
- package/source/css/_layout/tag-plugins/quot.styl +6 -6
- package/source/css/_layout/tag-plugins/tabs.styl +2 -2
- package/source/css/_layout/tag-plugins/timeline.styl +1 -5
- package/source/css/_layout/tag-plugins/toc.styl +1 -1
- package/source/css/_layout/widgets/search.styl +28 -18
- package/source/css/_layout/widgets/toc_wiki.styl +1 -1
- package/source/css/_plugins/aplayer.styl +3 -0
- package/source/css/_plugins/comments/artalk.styl +4 -0
- package/source/css/_plugins/comments/utterances.styl +1 -1
- package/source/css/_plugins/index.styl +4 -0
- package/source/css/_plugins/swiper.styl +17 -7
- package/source/js/main.js +30 -6
- package/scripts/tags/ablock.js +0 -33
- package/scripts/tags/about.js +0 -48
- package/scripts/tags/checkbox.js +0 -38
- package/scripts/tags/emoji.js +0 -40
- package/scripts/tags/folding.js +0 -30
- package/scripts/tags/frame.js +0 -66
- package/scripts/tags/friends.js +0 -53
- package/scripts/tags/lib/users.js +0 -22
- package/scripts/tags/link.js +0 -79
- package/scripts/tags/mark.js +0 -23
- package/scripts/tags/navbar.js +0 -57
- package/scripts/tags/note.js +0 -35
- package/scripts/tags/poetry.js +0 -47
- package/scripts/tags/sites.js +0 -57
- package/scripts/tags/swiper.js +0 -38
- package/scripts/tags/timeline.js +0 -81
- package/scripts/tags/toc.js +0 -72
package/scripts/tags/poetry.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* poetry.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
-
*
|
|
5
|
-
* poetry:
|
|
6
|
-
* {% poetry [title] [author:作者] [date:日期] [footer:footer] %}
|
|
7
|
-
* body
|
|
8
|
-
* {% endpoetry %}
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
hexo.extend.tag.register('poetry', function(args, content) {
|
|
15
|
-
var el = '';
|
|
16
|
-
args = hexo.args.map(args, ['author', 'date', 'footer'], ['title']);
|
|
17
|
-
|
|
18
|
-
el += '<div class="tag-plugin poetry"';
|
|
19
|
-
el += '>';
|
|
20
|
-
el += '<div class="content">'
|
|
21
|
-
if (args.title) {
|
|
22
|
-
el += '<div class="title">';
|
|
23
|
-
el += args.title;
|
|
24
|
-
el += '</div>';
|
|
25
|
-
}
|
|
26
|
-
if (args.author || args.date) {
|
|
27
|
-
el += '<div class="meta">';
|
|
28
|
-
if (args.author) {
|
|
29
|
-
el += '<span>' + args.author + '</span>';
|
|
30
|
-
}
|
|
31
|
-
if (args.date) {
|
|
32
|
-
el += '<span>' + args.date + '</span>';
|
|
33
|
-
}
|
|
34
|
-
el += '</div>';
|
|
35
|
-
}
|
|
36
|
-
el += '<div class="body">';
|
|
37
|
-
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
38
|
-
el += '</div>';
|
|
39
|
-
if (args.footer) {
|
|
40
|
-
el += '<div class="footer">';
|
|
41
|
-
el += args.footer;
|
|
42
|
-
el += '</div>';
|
|
43
|
-
}
|
|
44
|
-
el += '</div>'
|
|
45
|
-
el += '</div>';
|
|
46
|
-
return el;
|
|
47
|
-
}, {ends: true});
|
package/scripts/tags/sites.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* sites.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
-
*
|
|
5
|
-
* {% sites [group] [repo:owner/repo] [api:http] %}
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
hexo.extend.tag.register('sites', function(args) {
|
|
11
|
-
args = hexo.args.map(args, ['repo', 'api'], ['group']);
|
|
12
|
-
var links = hexo.locals.get('data').links;
|
|
13
|
-
if (links == undefined) {
|
|
14
|
-
links = {};
|
|
15
|
-
}
|
|
16
|
-
var api;
|
|
17
|
-
if (args.api) {
|
|
18
|
-
api = args.api;
|
|
19
|
-
} else if (args.repo) {
|
|
20
|
-
api = 'https://api.vlts.cc/output_data/v2/' + args.repo;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var el = '<div class="tag-plugin sites-wrap">';
|
|
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 '';
|
|
45
|
-
}
|
|
46
|
-
}
|
|
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>';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
el += '</div>';
|
|
56
|
-
return el;
|
|
57
|
-
});
|
package/scripts/tags/swiper.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* swiper.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
-
*
|
|
5
|
-
* {% swiper %}
|
|
6
|
-
* 
|
|
7
|
-
* {% endswiper %}
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
'use strict';
|
|
11
|
-
|
|
12
|
-
hexo.extend.tag.register('swiper', function(args, content) {
|
|
13
|
-
args = hexo.args.map(args, ['width']);
|
|
14
|
-
var el = '';
|
|
15
|
-
function slide() {
|
|
16
|
-
let imgs = hexo.render.renderSync({text: content, engine: 'markdown'});
|
|
17
|
-
imgs = imgs.match(/<img(.*?)src="(.*?)"(.*?)>/gi);
|
|
18
|
-
if (imgs && imgs.length > 0) {
|
|
19
|
-
imgs.forEach((img, i) => {
|
|
20
|
-
img = img.replace('<img src', '<img no-lazy src');
|
|
21
|
-
el += '<div class="swiper-slide">' + img + '</div>';
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
el += '<div class="tag-plugin swiper-container" id="swiper-api"';
|
|
26
|
-
if (args.width && args.width.length > 0) {
|
|
27
|
-
el += ' ' + hexo.args.joinTags(args, 'width').join(' ');
|
|
28
|
-
}
|
|
29
|
-
el += '>';
|
|
30
|
-
el += '<div class="swiper-wrapper">';
|
|
31
|
-
slide();
|
|
32
|
-
el += '</div>';
|
|
33
|
-
el += '<div class="swiper-pagination"></div>';
|
|
34
|
-
el += '<div class="swiper-button-prev blur"></div>';
|
|
35
|
-
el += '<div class="swiper-button-next blur"></div>';
|
|
36
|
-
el += '</div>';
|
|
37
|
-
return el;
|
|
38
|
-
}, {ends: true});
|
package/scripts/tags/timeline.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* timeline.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
*
|
|
4
|
-
* {% timeline %}
|
|
5
|
-
*
|
|
6
|
-
* <!-- node header1 -->
|
|
7
|
-
* what happened 1
|
|
8
|
-
*
|
|
9
|
-
* <!-- node header2 -->
|
|
10
|
-
* what happened 2
|
|
11
|
-
*
|
|
12
|
-
* {% endtimeline %}
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
function layoutNodeTitle(content) {
|
|
18
|
-
var el = '';
|
|
19
|
-
el += '<div class="header">';
|
|
20
|
-
if (content && content.length > 0) {
|
|
21
|
-
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
22
|
-
}
|
|
23
|
-
el += '</div>';
|
|
24
|
-
return el;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function layoutNodeContent(content) {
|
|
28
|
-
var el = '';
|
|
29
|
-
el += '<div class="body fs14">';
|
|
30
|
-
if (content && content.length > 0) {
|
|
31
|
-
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
32
|
-
}
|
|
33
|
-
el += '</div>';
|
|
34
|
-
return el;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function postTimeline(args, content) {
|
|
39
|
-
args = hexo.args.map(args, ['api', 'user', 'type', 'limit', 'hide']);
|
|
40
|
-
var el = '';
|
|
41
|
-
if (!args.type) {
|
|
42
|
-
args.type = 'timeline';
|
|
43
|
-
}
|
|
44
|
-
if (args.api && args.api.length > 0) {
|
|
45
|
-
el += '<div class="tag-plugin timeline stellar-' + args.type + '-api"';
|
|
46
|
-
el += ' ' + hexo.args.joinTags(args, ['api', 'user', 'limit', 'hide']).join(' ');
|
|
47
|
-
el += '>';
|
|
48
|
-
} else {
|
|
49
|
-
el += '<div class="tag-plugin timeline">';
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var arr = content.split(/<!--\s*node (.*?)\s*-->/g).filter(item => item.trim().length > 0)
|
|
53
|
-
if (arr.length > 0) {
|
|
54
|
-
var nodes = [];
|
|
55
|
-
arr.forEach((item, i) => {
|
|
56
|
-
if (i % 2 == 0) {
|
|
57
|
-
nodes.push({
|
|
58
|
-
header: item
|
|
59
|
-
});
|
|
60
|
-
} else if (nodes.length > 0) {
|
|
61
|
-
var node = nodes[nodes.length-1];
|
|
62
|
-
if (node.body == undefined) {
|
|
63
|
-
node.body = item;
|
|
64
|
-
} else {
|
|
65
|
-
node.body += '\n' + item;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
nodes.forEach((node, i) => {
|
|
70
|
-
el += '<div class="timenode" index="' + (i) + '">';
|
|
71
|
-
el += layoutNodeTitle(node.header);
|
|
72
|
-
el += layoutNodeContent(node.body);
|
|
73
|
-
el += '</div>';
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
el += '</div>';
|
|
78
|
-
return el;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
hexo.extend.tag.register('timeline', postTimeline, {ends: true});
|
package/scripts/tags/toc.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* toc.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
-
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
-
*
|
|
5
|
-
* {% toc wiki:xxx [title] [open:true] [display:mobile] %}
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
function layoutDocTree(pages) {
|
|
11
|
-
var el = '';
|
|
12
|
-
el += '<ul class="toc">';
|
|
13
|
-
pages.forEach((p, i) => {
|
|
14
|
-
el += '<li>';
|
|
15
|
-
el += '<a class="list-link" href="' + p.permalink + '">';
|
|
16
|
-
el += '<span>' + (p.title || p.seo_title) + '</span>';
|
|
17
|
-
el += '</a>';
|
|
18
|
-
el += '</li>';
|
|
19
|
-
});
|
|
20
|
-
el += '</ul>';
|
|
21
|
-
return el;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
hexo.extend.tag.register('toc', function(args) {
|
|
25
|
-
args = hexo.args.map(args, ['wiki', 'open', 'display'], ['title']);
|
|
26
|
-
|
|
27
|
-
var el = '';
|
|
28
|
-
el += '<div class="tag-plugin toc"';
|
|
29
|
-
el += ' ' + hexo.args.joinTags(args, ['display']).join(' ');
|
|
30
|
-
if (args.display === 'mobile') {
|
|
31
|
-
el += ' style="display:none"';
|
|
32
|
-
}
|
|
33
|
-
el += '>';
|
|
34
|
-
|
|
35
|
-
el += '<details class="toc"';
|
|
36
|
-
if (args.open != 'false') {
|
|
37
|
-
el += ' open';
|
|
38
|
-
}
|
|
39
|
-
el += '>';
|
|
40
|
-
el += '<summary>';
|
|
41
|
-
el += args.title || 'TOC';
|
|
42
|
-
el += '</summary>';
|
|
43
|
-
|
|
44
|
-
if (args.wiki) {
|
|
45
|
-
const proj = hexo.theme.config.wiki.projects[args.wiki];
|
|
46
|
-
if (proj == undefined) {
|
|
47
|
-
return '';
|
|
48
|
-
}
|
|
49
|
-
if (proj.sections && proj.sections.length > 1) {
|
|
50
|
-
el += '<div class="body fs14 multi">';
|
|
51
|
-
proj.sections.forEach((sec, i) => {
|
|
52
|
-
el += '<section>';
|
|
53
|
-
el += '<div class="header">';
|
|
54
|
-
el += sec.title;
|
|
55
|
-
el += '</div>';
|
|
56
|
-
el += layoutDocTree(sec.pages);
|
|
57
|
-
el += '</section>';
|
|
58
|
-
});
|
|
59
|
-
el += '</div>';
|
|
60
|
-
} else {
|
|
61
|
-
el += '<div class="body fs14">';
|
|
62
|
-
el += '<div class="body">';
|
|
63
|
-
el += layoutDocTree(proj.pages);
|
|
64
|
-
el += '</div>';
|
|
65
|
-
el += '</div>';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
el += '</details>';
|
|
69
|
-
// end
|
|
70
|
-
el += '</div>';
|
|
71
|
-
return el;
|
|
72
|
-
});
|