hexo-theme-stellar 1.18.0 → 1.18.1
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 +16 -32
- 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/_defines/theme.styl +6 -6
- package/source/css/_layout/md.styl +10 -10
- package/source/css/_layout/partial/related.styl +7 -5
- package/source/css/_layout/tag-plugins/folders.styl +8 -8
- package/source/css/_layout/tag-plugins/quot.styl +3 -5
- package/source/css/_layout/widgets/search.styl +1 -0
- 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 +7 -4
- package/source/js/main.js +7 -5
- 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/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Stellar 是一个内置文档系统的简约商务风 Hexo 主题,支持丰富的标签和动态数据组件,请配合 [文档](https://xaoxuu.com/wiki/stellar/) 使用。
|
|
4
4
|
|
|
5
|
-
[](https://starchart.cc/xaoxuu/hexo-theme-stellar)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
## Getting Started
|
|
@@ -12,7 +12,7 @@ Check your environment:
|
|
|
12
12
|
```yaml
|
|
13
13
|
Hexo: 5.4.0 ~ 6.3.0
|
|
14
14
|
hexo-cli: 4.3.0 ~ latest
|
|
15
|
-
node.js: 14.17.3
|
|
15
|
+
node.js: 14.17.3 ~ 18.12.0
|
|
16
16
|
npm: 6.14.13 ~ 8.19.2
|
|
17
17
|
```
|
|
18
18
|
|
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.18.
|
|
3
|
+
version: '1.18.1'
|
|
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
|
|
@@ -84,7 +84,7 @@ search:
|
|
|
84
84
|
|
|
85
85
|
######## Comments ########
|
|
86
86
|
comments:
|
|
87
|
-
service: # beaudar, utterances, twikoo, waline
|
|
87
|
+
service: # beaudar, utterances, giscus, twikoo, waline, artalk
|
|
88
88
|
# beaudar
|
|
89
89
|
# https://beaudar.lipk.org/
|
|
90
90
|
beaudar:
|
|
@@ -128,22 +128,18 @@ comments:
|
|
|
128
128
|
twikoo:
|
|
129
129
|
js: https://fastly.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本
|
|
130
130
|
envId: https://xxx # vercel函数
|
|
131
|
+
|
|
132
|
+
# Waline
|
|
133
|
+
# https://waline.js.org/
|
|
131
134
|
waline:
|
|
132
135
|
js: https://unpkg.com/@waline/client@v2/dist/waline.js
|
|
133
136
|
css: https://unpkg.com/@waline/client@v2/dist/waline.css
|
|
134
137
|
# Waline server address url, you should set this to your own link
|
|
135
138
|
serverURL:
|
|
136
|
-
|
|
137
139
|
# If false, comment count will only be displayed in post page, not in home page
|
|
138
140
|
commentCount: true
|
|
139
|
-
|
|
140
141
|
# Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`.
|
|
141
142
|
pageview: false
|
|
142
|
-
|
|
143
|
-
# Custom locales
|
|
144
|
-
# locale:
|
|
145
|
-
# placeholder: Welcome to comment # Comment box placeholder
|
|
146
|
-
|
|
147
143
|
# Custom emoji
|
|
148
144
|
# emoji:
|
|
149
145
|
# - https://unpkg.com/@waline/emojis@1.1.0/weibo
|
|
@@ -153,28 +149,16 @@ comments:
|
|
|
153
149
|
# - https://unpkg.com/@waline/emojis@1.1.0/tieba
|
|
154
150
|
# - https://unpkg.com/@waline/emojis@1.1.0/tw-emoji
|
|
155
151
|
# - https://unpkg.com/@waline/emojis@1.1.0/bmoji
|
|
152
|
+
|
|
153
|
+
# Artalk
|
|
154
|
+
# https://artalk.js.org/
|
|
155
|
+
artalk:
|
|
156
|
+
css: https://unpkg.com/artalk@2.4.3/dist/Artalk.css
|
|
157
|
+
js: https://unpkg.com/artalk@2.4.3/dist/Artalk.js
|
|
158
|
+
server: # 后端服务地址
|
|
159
|
+
placeholder: ''
|
|
160
|
+
darkMode: auto
|
|
156
161
|
|
|
157
|
-
# Comment infomation, valid meta are nick, mail and link
|
|
158
|
-
# meta:
|
|
159
|
-
# - nick
|
|
160
|
-
# - mail
|
|
161
|
-
# - link
|
|
162
|
-
|
|
163
|
-
# Set required meta field, e.g.: [nick] | [nick, mail]
|
|
164
|
-
# requiredMeta:
|
|
165
|
-
# - nick
|
|
166
|
-
|
|
167
|
-
# Language, available values: en-US, zh-CN, zh-TW, pt-BR, ru-RU, jp-JP
|
|
168
|
-
# lang: zh-CN
|
|
169
|
-
|
|
170
|
-
# Word limit, no limit when setting to 0
|
|
171
|
-
# wordLimit: 0
|
|
172
|
-
|
|
173
|
-
# Whether enable login, can choose from 'enable', 'disable' and 'force'
|
|
174
|
-
# login: enable
|
|
175
|
-
|
|
176
|
-
# comment per page
|
|
177
|
-
# pageSize: 10
|
|
178
162
|
|
|
179
163
|
######## Footer ########
|
|
180
164
|
footer:
|
|
@@ -304,8 +288,8 @@ plugins:
|
|
|
304
288
|
# swiper
|
|
305
289
|
swiper:
|
|
306
290
|
enable: true
|
|
307
|
-
css: https://unpkg.com/swiper@
|
|
308
|
-
js: https://unpkg.com/swiper@
|
|
291
|
+
css: https://unpkg.com/swiper@8/swiper-bundle.min.css
|
|
292
|
+
js: https://unpkg.com/swiper@8/swiper-bundle.min.js
|
|
309
293
|
|
|
310
294
|
|
|
311
295
|
# 赫蹏 (Heti) - 专为中文网页内容设计的排版样式增强
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%
|
|
2
|
+
function layoutDiv() {
|
|
3
|
+
var el = '';
|
|
4
|
+
el += '<div id="artalk_container"';
|
|
5
|
+
let cfg = {};
|
|
6
|
+
if (page.comment_id) {
|
|
7
|
+
cfg['comment_id'] = page.comment_id;
|
|
8
|
+
}
|
|
9
|
+
for (let key of Object.keys(cfg)) {
|
|
10
|
+
if (cfg[key]) {
|
|
11
|
+
el += ' ' + key + '="' + cfg[key] + '"';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
el += '><svg class="loading" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2709"><path d="M832 512c0-176-144-320-320-320V128c211.2 0 384 172.8 384 384h-64zM192 512c0 176 144 320 320 320v64C300.8 896 128 723.2 128 512h64z" p-id="2710"></path></svg></div>';
|
|
15
|
+
return el;
|
|
16
|
+
}
|
|
17
|
+
%>
|
|
18
|
+
|
|
19
|
+
<%- layoutDiv() %>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
function load_artalk() {
|
|
3
|
+
if (!document.querySelectorAll("#artalk_container")[0]) return;
|
|
4
|
+
stellar.loadCSS('<%- theme.comments.artalk.css %>');
|
|
5
|
+
stellar.loadScript('<%- theme.comments.artalk.js %>', {defer: true}).then(function () {
|
|
6
|
+
const el = document.getElementById("artalk_container");
|
|
7
|
+
var path = el.getAttribute('comment_id');
|
|
8
|
+
if (!path) {
|
|
9
|
+
path = decodeURI(window.location.pathname);
|
|
10
|
+
}
|
|
11
|
+
var artalk = new Artalk({
|
|
12
|
+
el: '#artalk_container',
|
|
13
|
+
pageKey: path,
|
|
14
|
+
pageTitle: '<%= page.title || page.seo_title %>',
|
|
15
|
+
server: '<%= theme.comments.artalk.server %>',
|
|
16
|
+
placeholder: '<%= theme.comments.artalk.placeholder %>',
|
|
17
|
+
site: '<%= config.title %>',
|
|
18
|
+
darkMode: '<%= theme.comments.artalk.darkMode %>'
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
23
|
+
load_artalk();
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
@@ -32,11 +32,11 @@ page.cmt = cmt;
|
|
|
32
32
|
%>
|
|
33
33
|
<% if (loadComment) { %>
|
|
34
34
|
<div class='related-wrap md-text reveal' id="comments">
|
|
35
|
-
<
|
|
35
|
+
<section class='header cmt-title cap theme'>
|
|
36
36
|
<%- page.comment_title != undefined ? markdown(page.comment_title) : __('meta.comment_title') %>
|
|
37
|
-
</
|
|
38
|
-
<
|
|
37
|
+
</section>
|
|
38
|
+
<section class='body cmt-body <%- cmt.service %>'>
|
|
39
39
|
<%- partial(cmt.service + '/layout') %>
|
|
40
|
-
</
|
|
40
|
+
</section>
|
|
41
41
|
</div>
|
|
42
42
|
<% } %>
|
|
@@ -63,7 +63,7 @@ function layoutDiv(fallback) {
|
|
|
63
63
|
|
|
64
64
|
var el = '';
|
|
65
65
|
if (type.length > 0) {
|
|
66
|
-
el += '<widget class="widget-wrapper toc ' + type + '" id="toc">';
|
|
66
|
+
el += '<widget class="widget-wrapper toc ' + type + '" id="data-toc">';
|
|
67
67
|
if (page.layout !== 'wiki') {
|
|
68
68
|
// post 布局
|
|
69
69
|
el += layoutTocHeader(page.toc_title);
|
package/package.json
CHANGED
package/scripts/tags/index.js
CHANGED
|
@@ -2,10 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
hexo.extend.tag.register('tabs',
|
|
7
|
-
hexo.extend.tag.register('
|
|
8
|
-
hexo.extend.tag.register('
|
|
5
|
+
// container
|
|
6
|
+
hexo.extend.tag.register('tabs', require('./lib/tabs')(hexo), true)
|
|
7
|
+
hexo.extend.tag.register('ablock', require('./lib/ablock')(hexo), true)
|
|
8
|
+
hexo.extend.tag.register('about', require('./lib/about')(hexo), true)
|
|
9
|
+
hexo.extend.tag.register('folding', require('./lib/folding')(hexo), true)
|
|
10
|
+
hexo.extend.tag.register('folders', require('./lib/folders')(hexo), true)
|
|
11
|
+
hexo.extend.tag.register('grid', require('./lib/grid')(hexo), true)
|
|
12
|
+
hexo.extend.tag.register('swiper', require('./lib/swiper')(hexo), true)
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
hexo.extend.tag.register('users',
|
|
14
|
+
// data
|
|
15
|
+
hexo.extend.tag.register('users', require('./lib/friends')(hexo))
|
|
16
|
+
hexo.extend.tag.register('friends', require('./lib/friends')(hexo))
|
|
17
|
+
hexo.extend.tag.register('sites', require('./lib/sites')(hexo))
|
|
18
|
+
hexo.extend.tag.register('ghcard', require('./lib/ghcard')(hexo))
|
|
19
|
+
hexo.extend.tag.register('toc', require('./lib/toc')(hexo))
|
|
20
|
+
hexo.extend.tag.register('timeline', require('./lib/timeline')(hexo), {ends: true})
|
|
21
|
+
|
|
22
|
+
// express
|
|
23
|
+
hexo.extend.tag.register('checkbox', require('./lib/checkbox')(hexo, 'checkbox'))
|
|
24
|
+
hexo.extend.tag.register('radio', require('./lib/checkbox')(hexo, 'radio'))
|
|
25
|
+
hexo.extend.tag.register('copy', require('./lib/copy')(hexo))
|
|
26
|
+
hexo.extend.tag.register('emoji', require('./lib/emoji')(hexo))
|
|
27
|
+
hexo.extend.tag.register('frame', require('./lib/frame')(hexo))
|
|
28
|
+
hexo.extend.tag.register('image', require('./lib/image')(hexo))
|
|
29
|
+
hexo.extend.tag.register('link', require('./lib/link')(hexo))
|
|
30
|
+
hexo.extend.tag.register('mark', require('./lib/mark')(hexo))
|
|
31
|
+
hexo.extend.tag.register('navbar', require('./lib/navbar')(hexo))
|
|
32
|
+
hexo.extend.tag.register('note', require('./lib/note')(hexo))
|
|
33
|
+
hexo.extend.tag.register('poetry', require('./lib/poetry')(hexo), true)
|
|
34
|
+
hexo.extend.tag.register('quot', require('./lib/quot')(hexo))
|
|
35
|
+
hexo.extend.tag.register('tag', require('./lib/tag')(hexo))
|
|
36
|
+
|
|
37
|
+
// others
|
|
@@ -5,40 +5,40 @@
|
|
|
5
5
|
* {% psw 这是密码 %}
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
'use strict'
|
|
8
|
+
'use strict'
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
hexo.extend.tag.register('u', function(args) {
|
|
12
|
-
return `<u>${args.join(' ')}</u
|
|
13
|
-
})
|
|
12
|
+
return `<u>${args.join(' ')}</u>`
|
|
13
|
+
})
|
|
14
14
|
hexo.extend.tag.register('emp', function(args) {
|
|
15
|
-
return `<emp>${args.join(' ')}</emp
|
|
16
|
-
})
|
|
15
|
+
return `<emp>${args.join(' ')}</emp>`
|
|
16
|
+
})
|
|
17
17
|
hexo.extend.tag.register('wavy', function(args) {
|
|
18
|
-
return `<wavy>${args.join(' ')}</wavy
|
|
19
|
-
})
|
|
18
|
+
return `<wavy>${args.join(' ')}</wavy>`
|
|
19
|
+
})
|
|
20
20
|
hexo.extend.tag.register('del', function(args) {
|
|
21
|
-
return `<del>${args.join(' ')}</del
|
|
22
|
-
})
|
|
21
|
+
return `<del>${args.join(' ')}</del>`
|
|
22
|
+
})
|
|
23
23
|
hexo.extend.tag.register('kbd', function(args) {
|
|
24
|
-
return `<kbd>${args.join(' ')}</kbd
|
|
25
|
-
})
|
|
24
|
+
return `<kbd>${args.join(' ')}</kbd>`
|
|
25
|
+
})
|
|
26
26
|
hexo.extend.tag.register('psw', function(args) {
|
|
27
|
-
return `<psw>${args.join(' ')}</psw
|
|
28
|
-
})
|
|
27
|
+
return `<psw>${args.join(' ')}</psw>`
|
|
28
|
+
})
|
|
29
29
|
hexo.extend.tag.register('sup', function(args) {
|
|
30
|
-
args = hexo.args.map(args, ['color'], ['text'])
|
|
31
|
-
var el = ''
|
|
32
|
-
el += '<sup class="tag-plugin sup"' + ' ' + hexo.args.joinTags(args, ['color']).join(' ') + '>'
|
|
33
|
-
el += args.text
|
|
34
|
-
el += '</sup>'
|
|
35
|
-
return el
|
|
36
|
-
})
|
|
30
|
+
args = hexo.args.map(args, ['color'], ['text'])
|
|
31
|
+
var el = ''
|
|
32
|
+
el += '<sup class="tag-plugin sup"' + ' ' + hexo.args.joinTags(args, ['color']).join(' ') + '>'
|
|
33
|
+
el += args.text
|
|
34
|
+
el += '</sup>'
|
|
35
|
+
return el
|
|
36
|
+
})
|
|
37
37
|
hexo.extend.tag.register('sub', function(args) {
|
|
38
|
-
args = hexo.args.map(args, ['color'], ['text'])
|
|
39
|
-
var el = ''
|
|
40
|
-
el += '<sub class="tag-plugin sub"' + ' ' + hexo.args.joinTags(args, ['color']).join(' ') + '>'
|
|
41
|
-
el += args.text
|
|
42
|
-
el += '</sub>'
|
|
43
|
-
return el
|
|
44
|
-
})
|
|
38
|
+
args = hexo.args.map(args, ['color'], ['text'])
|
|
39
|
+
var el = ''
|
|
40
|
+
el += '<sub class="tag-plugin sub"' + ' ' + hexo.args.joinTags(args, ['color']).join(' ') + '>'
|
|
41
|
+
el += args.text
|
|
42
|
+
el += '</sub>'
|
|
43
|
+
return el
|
|
44
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ablock.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% ablock [color:color] [child:codeblock/tabs] title %}
|
|
6
|
+
* body
|
|
7
|
+
* {% endablock %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
module.exports = ctx => function(args, content) {
|
|
13
|
+
args = ctx.args.map(args, ['color', 'child'], ['title'])
|
|
14
|
+
const { title } = args
|
|
15
|
+
if (args.color == null) {
|
|
16
|
+
args.color = ctx.theme.config.tag_plugins.note.default_color
|
|
17
|
+
}
|
|
18
|
+
var el = ''
|
|
19
|
+
// header
|
|
20
|
+
el += '<div class="tag-plugin note"'
|
|
21
|
+
el += ' ' + ctx.args.joinTags(args, ['color', 'child']).join(' ')
|
|
22
|
+
el += '>'
|
|
23
|
+
// title
|
|
24
|
+
if (title && title.length > 0) {
|
|
25
|
+
el += '<div class="title"><strong>' + title + '</strong></div>'
|
|
26
|
+
}
|
|
27
|
+
// content
|
|
28
|
+
el += '<div class="body">'
|
|
29
|
+
el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
|
|
30
|
+
el += '</div></div>'
|
|
31
|
+
|
|
32
|
+
return el
|
|
33
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* about.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% about [avatar:xxx] [height:80px] %}
|
|
6
|
+
* title / body
|
|
7
|
+
* {% endabout %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
module.exports = ctx => function(args, content) {
|
|
13
|
+
const url_for = require('hexo-util').url_for.bind(ctx)
|
|
14
|
+
args = ctx.args.map(args, ['avatar', 'height', 'border', 'back'])
|
|
15
|
+
var rows = ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n')
|
|
16
|
+
var el = ''
|
|
17
|
+
// wrapper
|
|
18
|
+
el += '<div class="tag-plugin about">'
|
|
19
|
+
if (args.back) {
|
|
20
|
+
el += '<a class="nav-back cap" href="' + url_for(ctx.config.root) + '">'
|
|
21
|
+
el += '<svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>'
|
|
22
|
+
el += '</a>'
|
|
23
|
+
}
|
|
24
|
+
// avatar
|
|
25
|
+
var avatar_url = args.avatar
|
|
26
|
+
if (avatar_url) {
|
|
27
|
+
el += '<div class="about-header">'
|
|
28
|
+
el += '<div class="avatar">'
|
|
29
|
+
el += '<img src="' + avatar_url + '"'
|
|
30
|
+
if (args.border && args.border.length > 0) {
|
|
31
|
+
el += ' style="border-radius:' + args.border + '"'
|
|
32
|
+
}
|
|
33
|
+
if (args.height && args.height.length > 0) {
|
|
34
|
+
el += ' height="' + args.height + '"'
|
|
35
|
+
}
|
|
36
|
+
el += '/>'
|
|
37
|
+
el += '</div>'
|
|
38
|
+
el += '</div>'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// content
|
|
42
|
+
el += '<div class="about-body fs14">'
|
|
43
|
+
el += rows.join('')
|
|
44
|
+
el += '</div>'
|
|
45
|
+
|
|
46
|
+
el += '</div>'
|
|
47
|
+
return el
|
|
48
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* checkbox.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* radio.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
4
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
5
|
+
*
|
|
6
|
+
* {% checkbox [checked:false] [color:cyan] [symbol:plus/minus/times] text %}
|
|
7
|
+
* {% radio [checked:false] [color:cyan] text %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict'
|
|
11
|
+
|
|
12
|
+
module.exports = (ctx, type) => function(args) {
|
|
13
|
+
args = ctx.args.map(args, ['color', 'checked', 'symbol'], ['text'])
|
|
14
|
+
var el = ''
|
|
15
|
+
// div
|
|
16
|
+
el += '<div class="tag-plugin checkbox"'
|
|
17
|
+
el += ' ' + ctx.args.joinTags(args, ['color', 'symbol']).join(' ')
|
|
18
|
+
el += '>'
|
|
19
|
+
// input
|
|
20
|
+
el += '<input type="' + (type || 'checkbox') + '"'
|
|
21
|
+
if (args.checked == 'true') {
|
|
22
|
+
el += ' checked="true"'
|
|
23
|
+
}
|
|
24
|
+
el += '/>'
|
|
25
|
+
// text
|
|
26
|
+
el += '<span>' + args.text + '</span>'
|
|
27
|
+
// div
|
|
28
|
+
el += '</div>'
|
|
29
|
+
return el
|
|
30
|
+
}
|
|
@@ -7,43 +7,43 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
'use strict'
|
|
10
|
+
'use strict'
|
|
11
11
|
|
|
12
|
-
var copy_index = 0
|
|
12
|
+
var copy_index = 0
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
args =
|
|
14
|
+
module.exports = ctx => function(args) {
|
|
15
|
+
args = ctx.args.map(args, ['width', 'git'], ['text'])
|
|
16
16
|
if (args == undefined || args.text == undefined) {
|
|
17
|
-
return ''
|
|
17
|
+
return ''
|
|
18
18
|
}
|
|
19
|
-
var text = args.text
|
|
19
|
+
var text = args.text
|
|
20
20
|
if (args.git) {
|
|
21
21
|
if (text.substr(0,1) == '/') {
|
|
22
|
-
text = text.substring(1)
|
|
22
|
+
text = text.substring(1)
|
|
23
23
|
}
|
|
24
24
|
if (args.git == 'ssh') {
|
|
25
|
-
text = 'git@github.com:' + text + '.git'
|
|
25
|
+
text = 'git@github.com:' + text + '.git'
|
|
26
26
|
} else if (args.git == 'gh') {
|
|
27
|
-
text = 'gh repo clone ' + text
|
|
27
|
+
text = 'gh repo clone ' + text
|
|
28
28
|
} else {
|
|
29
|
-
text = 'https://github.com/' + text + '.git'
|
|
29
|
+
text = 'https://github.com/' + text + '.git'
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const copy_id = 'copy_' + ++copy_index
|
|
33
|
+
const copy_id = 'copy_' + ++copy_index
|
|
34
34
|
|
|
35
|
-
var el = ''
|
|
36
|
-
el += '<div class="tag-plugin copy"'
|
|
35
|
+
var el = ''
|
|
36
|
+
el += '<div class="tag-plugin copy"'
|
|
37
37
|
if (args.width) {
|
|
38
|
-
el += ' width="' + args.width + '"'
|
|
38
|
+
el += ' width="' + args.width + '"'
|
|
39
39
|
}
|
|
40
|
-
el += '>'
|
|
41
|
-
el += '<input class="copy-area" readonly id="' + copy_id + '"'
|
|
42
|
-
el += ' value="' + text + '">'
|
|
43
|
-
el += '<button class="copy-btn" onclick="util.copy("
|
|
44
|
-
el += '<svg class="icon copy-btn" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z"></path></svg>'
|
|
45
|
-
el += '</button>'
|
|
40
|
+
el += '>'
|
|
41
|
+
el += '<input class="copy-area" readonly id="' + copy_id + '"'
|
|
42
|
+
el += ' value="' + text + '">'
|
|
43
|
+
el += '<button class="copy-btn" onclick="util.copy("' + copy_id + '","Copied!")">'
|
|
44
|
+
el += '<svg class="icon copy-btn" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z"></path></svg>'
|
|
45
|
+
el += '</button>'
|
|
46
46
|
|
|
47
|
-
el += '</div>'
|
|
48
|
-
return el
|
|
49
|
-
}
|
|
47
|
+
el += '</div>'
|
|
48
|
+
return el
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* emoji.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% emoji [source] name [height:1.75em] %}
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'
|
|
10
|
+
|
|
11
|
+
module.exports = ctx => function(args) {
|
|
12
|
+
const config = ctx.theme.config.tag_plugins.emoji
|
|
13
|
+
args = ctx.args.map(args, ['height'], ['source', 'name'])
|
|
14
|
+
var el = ''
|
|
15
|
+
if (args.source == undefined) {
|
|
16
|
+
return el
|
|
17
|
+
}
|
|
18
|
+
el += '<span class="tag-plugin emoji">'
|
|
19
|
+
if (args.name == undefined) {
|
|
20
|
+
// 省略了 source
|
|
21
|
+
for (let id in config) {
|
|
22
|
+
if (config[id]) {
|
|
23
|
+
args.name = args.source
|
|
24
|
+
args.source = id
|
|
25
|
+
break
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (config[args.source] && args.name) {
|
|
30
|
+
let url = config[args.source].replace('%s', args.name)
|
|
31
|
+
el += '<img no-lazy="" class="inline"'
|
|
32
|
+
el += ' src="' + url + '"'
|
|
33
|
+
if (args.height) {
|
|
34
|
+
el += ' style="height:' + args.height + '"'
|
|
35
|
+
}
|
|
36
|
+
el += '/>'
|
|
37
|
+
}
|
|
38
|
+
el += '</span>'
|
|
39
|
+
return el
|
|
40
|
+
}
|
|
@@ -10,44 +10,44 @@
|
|
|
10
10
|
* {% endtable %}
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
'use strict'
|
|
13
|
+
'use strict'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
args =
|
|
17
|
-
var el = ''
|
|
18
|
-
el += '<div class="tag-plugin folders"'
|
|
19
|
-
el += ' ' +
|
|
20
|
-
el += '>'
|
|
15
|
+
module.exports = ctx => function(args, content) {
|
|
16
|
+
args = ctx.args.map(args, ['color'])
|
|
17
|
+
var el = ''
|
|
18
|
+
el += '<div class="tag-plugin folders"'
|
|
19
|
+
el += ' ' + ctx.args.joinTags(args, ['color']).join(' ')
|
|
20
|
+
el += '>'
|
|
21
21
|
|
|
22
22
|
var arr = content.split(/<!--\s*folder (.*?)\s*-->/g).filter(item => item.trim().length > 0)
|
|
23
23
|
if (arr.length > 0) {
|
|
24
|
-
var nodes = []
|
|
24
|
+
var nodes = []
|
|
25
25
|
arr.forEach((item, i) => {
|
|
26
26
|
if (i % 2 == 0) {
|
|
27
27
|
nodes.push({
|
|
28
28
|
header: item
|
|
29
|
-
})
|
|
29
|
+
})
|
|
30
30
|
} else if (nodes.length > 0) {
|
|
31
|
-
var node = nodes[nodes.length-1]
|
|
31
|
+
var node = nodes[nodes.length-1]
|
|
32
32
|
if (node.body == undefined) {
|
|
33
|
-
node.body = item
|
|
33
|
+
node.body = item
|
|
34
34
|
} else {
|
|
35
|
-
node.body += '\n' + item
|
|
35
|
+
node.body += '\n' + item
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
})
|
|
38
|
+
})
|
|
39
39
|
nodes.forEach((node, i) => {
|
|
40
|
-
el += '<details class="folder" index="' + (i) + '">'
|
|
40
|
+
el += '<details class="folder" index="' + (i) + '">'
|
|
41
41
|
// summary
|
|
42
|
-
el += '<summary><span>' + (node.header || '') + '</span></summary>'
|
|
42
|
+
el += '<summary><span>' + (node.header || '') + '</span></summary>'
|
|
43
43
|
// content
|
|
44
|
-
el += '<div class="body">'
|
|
45
|
-
el +=
|
|
46
|
-
el += '</div></details>'
|
|
47
|
-
})
|
|
44
|
+
el += '<div class="body">'
|
|
45
|
+
el += ctx.render.renderSync({text: (node.body || ''), engine: 'markdown'}).split('\n').join('')
|
|
46
|
+
el += '</div></details>'
|
|
47
|
+
})
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
el += '</div>'
|
|
50
|
+
el += '</div>'
|
|
51
51
|
|
|
52
|
-
return el
|
|
53
|
-
}
|
|
52
|
+
return el
|
|
53
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* folding.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% folding [color:yellow] [child:codeblock] [open:false] title %}
|
|
6
|
+
* body
|
|
7
|
+
* {% endtable %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict'
|
|
11
|
+
|
|
12
|
+
module.exports = ctx => function(args, content) {
|
|
13
|
+
args = ctx.args.map(args, ['color', 'child', 'open'], ['title'])
|
|
14
|
+
var el = ''
|
|
15
|
+
// header
|
|
16
|
+
el += '<details class="tag-plugin folding"'
|
|
17
|
+
el += ' ' + ctx.args.joinTags(args, ['color', 'child']).join(' ')
|
|
18
|
+
if (args.open && args.open == 'true') {
|
|
19
|
+
el += ' open'
|
|
20
|
+
}
|
|
21
|
+
el += '>'
|
|
22
|
+
// summary
|
|
23
|
+
el += '<summary><span>' + (args.title || '') + '</span></summary>'
|
|
24
|
+
// content
|
|
25
|
+
el += '<div class="body">'
|
|
26
|
+
el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')
|
|
27
|
+
el += '</div></details>'
|
|
28
|
+
|
|
29
|
+
return el
|
|
30
|
+
}
|