hexo-theme-stellar 1.23.0 → 1.24.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/_config.yml +5 -2
- package/layout/_partial/main/article/article_footer.ejs +16 -5
- package/layout/_partial/main/footer.ejs +18 -24
- package/layout/_partial/widgets/markdown.ejs +7 -2
- package/layout/_partial/widgets/search.ejs +2 -2
- package/package.json +1 -1
- package/scripts/tags/index.js +3 -0
- package/scripts/tags/lib/audio.js +23 -0
- package/scripts/tags/lib/grid.js +30 -30
- package/scripts/tags/lib/md.js +20 -0
- package/scripts/tags/lib/video.js +31 -0
- package/source/css/_common/media.styl +4 -0
- package/source/css/_layout/list.styl +4 -10
- package/source/css/_layout/md.styl +3 -0
- package/source/css/_layout/pages/archives.styl +3 -7
- package/source/css/_layout/partial/cover.styl +1 -0
- package/source/css/_layout/tag-plugins/banner.styl +2 -2
- package/source/css/_layout/tag-plugins/folding.styl +6 -0
- package/source/css/_layout/tag-plugins/friends.styl +4 -1
- package/source/css/_layout/tag-plugins/grid.styl +2 -6
- package/source/css/_layout/tag-plugins/link.styl +1 -1
- package/source/css/_layout/tag-plugins/media.styl +11 -0
- package/source/css/_layout/tag-plugins/note.styl +7 -0
- package/source/css/_layout/widgets/search.styl +17 -28
- package/source/css/_plugins/copycode.styl +17 -16
- package/source/js/main.js +2 -2
- package/source/js/plugins/copycode.js +1 -1
- package/source/js/plugins/marked.js +50 -0
- package/source/js/search/local-search.js +4 -1
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.
|
|
3
|
+
version: '1.24.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
|
|
@@ -59,6 +59,8 @@ breadcrumb:
|
|
|
59
59
|
article:
|
|
60
60
|
# 如果没有指定封面,是否根据 tags 作为关键词搜索封面图片?
|
|
61
61
|
auto_cover: false # search from https://source.unsplash.com/
|
|
62
|
+
# 封面图宽高比
|
|
63
|
+
cover_ratio: 2.4
|
|
62
64
|
# 如果没有指定横幅,是否根据 tags 作为关键词搜索横幅图片?
|
|
63
65
|
auto_banner: false # search from https://source.unsplash.com/
|
|
64
66
|
# 如果没有指定 excerpt 和 description,将自动取多长的内容作为文章摘要?
|
|
@@ -213,7 +215,7 @@ footer:
|
|
|
213
215
|
# - '[关于本站](/)'
|
|
214
216
|
# - '[GitHub](/)'
|
|
215
217
|
content: | # 支持 Markdown 格式
|
|
216
|
-
本站由 [${author}](/) 使用 [${theme.name} ${theme.version}](${theme.tree}) 主题创建。
|
|
218
|
+
本站由 [${author.name}](/) 使用 [${theme.name} ${theme.version}](${theme.tree}) 主题创建。
|
|
217
219
|
本博客所有文章除特别声明外,均采用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) 许可协议,转载请注明出处。
|
|
218
220
|
# 主题用户越多,开发者维护和更新的积极性就越高,如果您喜欢本主题,请在适当的位置显示主题信息和仓库链接以表支持。
|
|
219
221
|
|
|
@@ -303,6 +305,7 @@ plugins:
|
|
|
303
305
|
fcircle: /js/plugins/fcircle.js
|
|
304
306
|
weibo: /js/plugins/weibo.js
|
|
305
307
|
memos: /js/plugins/memos.js
|
|
308
|
+
marked: /js/plugins/marked.js
|
|
306
309
|
|
|
307
310
|
marked: https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js
|
|
308
311
|
|
|
@@ -40,25 +40,36 @@ function layoutDiv() {
|
|
|
40
40
|
var license = ''
|
|
41
41
|
if (page.layout == 'post') {
|
|
42
42
|
if (theme.article.license && (page.license != false)) {
|
|
43
|
-
license =
|
|
43
|
+
license = page.license || theme.article.license
|
|
44
44
|
}
|
|
45
45
|
} else if (page.layout == 'wiki' && page.wiki) {
|
|
46
46
|
let proj = theme.wiki.tree[page.wiki]
|
|
47
47
|
if (page.license != null) {
|
|
48
|
-
license =
|
|
48
|
+
license = page.license || theme.article.license
|
|
49
49
|
} else if (proj?.license != null) {
|
|
50
50
|
if (proj.license == true) {
|
|
51
|
-
license =
|
|
51
|
+
license = theme.article.license
|
|
52
52
|
} else {
|
|
53
|
-
license =
|
|
53
|
+
license = proj.license
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
if (license.length > 0) {
|
|
58
|
+
var author = null
|
|
59
|
+
if (theme.authors) {
|
|
60
|
+
if (page.author?.length > 0 && theme.authors[page.author] != null) {
|
|
61
|
+
author = theme.authors[page.author]
|
|
62
|
+
} else {
|
|
63
|
+
author = theme.default_author
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (author) {
|
|
67
|
+
license = license.replace('${author.name}', author.name).replace('${author.url}', author.url)
|
|
68
|
+
}
|
|
58
69
|
el += `
|
|
59
70
|
<section id="license">
|
|
60
71
|
<div class="header"><span>${__('meta.license')}</span></div>
|
|
61
|
-
<div class="body">${license}</div>
|
|
72
|
+
<div class="body">${markdown(license)}</div>
|
|
62
73
|
</section>
|
|
63
74
|
`
|
|
64
75
|
}
|
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const content = theme.footer.content?.replace('${author}', config.author)?.replace('${theme.name}', stellar_info('name'))?.replace('${theme.version}', stellar_info('version'))?.replace('${theme.tree}', stellar_info('tree'))
|
|
2
|
+
const content = theme.footer.content?.replace('${author.name}', (config.author || 'Anonymity'))?.replace('${theme.name}', stellar_info('name'))?.replace('${theme.version}', stellar_info('version'))?.replace('${theme.tree}', stellar_info('tree'))
|
|
3
3
|
function layoutDiv() {
|
|
4
|
-
var el = ''
|
|
5
|
-
el += '<footer class="page-footer reveal fs12">'
|
|
6
|
-
el += '<hr>'
|
|
4
|
+
var el = ''
|
|
5
|
+
el += '<footer class="page-footer reveal fs12">'
|
|
6
|
+
el += '<hr>'
|
|
7
7
|
// sitemap
|
|
8
8
|
if (theme.footer.sitemap && Object.keys(theme.footer.sitemap).length > 0) {
|
|
9
|
-
el += '<div class="sitemap">'
|
|
9
|
+
el += '<div class="sitemap">'
|
|
10
10
|
for (let group of Object.keys(theme.footer.sitemap)) {
|
|
11
|
-
let items = theme.footer.sitemap[group]
|
|
11
|
+
let items = theme.footer.sitemap[group]
|
|
12
12
|
if (items == undefined || items.length == 0) {
|
|
13
|
-
continue
|
|
13
|
+
continue
|
|
14
14
|
}
|
|
15
|
-
el += '<div class="sitemap-group">'
|
|
16
|
-
el += '<span class="fs14">' + group + '</span>'
|
|
15
|
+
el += '<div class="sitemap-group">'
|
|
16
|
+
el += '<span class="fs14">' + group + '</span>'
|
|
17
17
|
items.forEach((item, i) => {
|
|
18
|
-
el += '<a href="' + url_for(md_link(item)) + '">'
|
|
19
|
-
el += __(md_text(item))
|
|
20
|
-
el += '</a>'
|
|
18
|
+
el += '<a href="' + url_for(md_link(item)) + '">'
|
|
19
|
+
el += __(md_text(item))
|
|
20
|
+
el += '</a>'
|
|
21
21
|
});
|
|
22
|
-
el += '</div>'
|
|
22
|
+
el += '</div>'
|
|
23
23
|
}
|
|
24
|
-
el += '</div>'
|
|
24
|
+
el += '</div>'
|
|
25
25
|
}
|
|
26
26
|
// footer
|
|
27
|
-
el += '<div class="text">'
|
|
27
|
+
el += '<div class="text">'
|
|
28
28
|
if (content) {
|
|
29
|
-
|
|
30
|
-
el += markdown(content);
|
|
31
|
-
} else if ((typeof content == 'object') && content.constructor == Array) {
|
|
32
|
-
content.forEach((item, i) => {
|
|
33
|
-
el += markdown(item);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
29
|
+
el += markdown(content)
|
|
36
30
|
}
|
|
37
|
-
el += '</div></footer>'
|
|
38
|
-
return el
|
|
31
|
+
el += '</div></footer>'
|
|
32
|
+
return el
|
|
39
33
|
}
|
|
40
34
|
%>
|
|
41
35
|
<%- layoutDiv() %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<%
|
|
2
2
|
function layoutDiv() {
|
|
3
|
-
if (!item.content?.length) return ''
|
|
3
|
+
if (!item.content?.length && !item.src?.length) return ''
|
|
4
4
|
var el = '';
|
|
5
5
|
el += '<widget class="widget-wrapper markdown">';
|
|
6
6
|
if (item.title?.length > 0) {
|
|
@@ -9,7 +9,12 @@ function layoutDiv() {
|
|
|
9
9
|
el += '</div>';
|
|
10
10
|
}
|
|
11
11
|
el += '<div class="widget-body fs14">';
|
|
12
|
-
|
|
12
|
+
if (item.content) {
|
|
13
|
+
el += markdown(item.content);
|
|
14
|
+
}
|
|
15
|
+
if (item.src) {
|
|
16
|
+
el += `<div class="stellar-marked-api md-marked" src="${item.src}"></div>`
|
|
17
|
+
}
|
|
13
18
|
el += '</div>';
|
|
14
19
|
el += '</widget>';
|
|
15
20
|
return el;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function layoutDiv() {
|
|
3
3
|
var el = '<widget class="widget-wrapper search">'
|
|
4
4
|
el += '<div class="widget-body">'
|
|
5
|
-
el += '<div class="search-wrapper" id="search">'
|
|
5
|
+
el += '<div class="search-wrapper" id="search-wrapper">'
|
|
6
6
|
el += '<form class="search-form">'
|
|
7
7
|
var filter = ''
|
|
8
8
|
if (item.filter == 'auto') {
|
|
@@ -27,7 +27,7 @@ function layoutDiv() {
|
|
|
27
27
|
} else {
|
|
28
28
|
el += ' placeholder="' + (item.placeholder || __('search.search')) + '">'
|
|
29
29
|
}
|
|
30
|
-
el += '<svg t="
|
|
30
|
+
el += '<svg t="1705074644177" class="icon search-icon" viewBox="0 0 1025 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1560" width="200" height="200"><path d="M1008.839137 935.96571L792.364903 719.491476a56.783488 56.783488 0 0 0-80.152866 0 358.53545 358.53545 0 1 1 100.857314-335.166073 362.840335 362.840335 0 0 1-3.689902 170.145468 51.248635 51.248635 0 1 0 99.217358 26.444296 462.057693 462.057693 0 1 0-158.255785 242.303546l185.930047 185.725053a51.248635 51.248635 0 0 0 72.568068 0 51.248635 51.248635 0 0 0 0-72.978056z" fill="#111111" p-id="1561"></path><path d="M616.479587 615.969233a50.428657 50.428657 0 0 0-61.498362-5.534852 174.655348 174.655348 0 0 1-177.525271 3.484907 49.403684 49.403684 0 0 0-58.833433 6.76482l-3.074918 2.869923a49.403684 49.403684 0 0 0 8.609771 78.10292 277.767601 277.767601 0 0 0 286.992355-5.739847 49.403684 49.403684 0 0 0 8.404776-76.667958z" fill="#00C569" p-id="1562"></path></svg>'
|
|
31
31
|
el += '</form>'
|
|
32
32
|
el += '<div id="search-result"></div>'
|
|
33
33
|
el += '<div class="search-no-result">' + __('search.no_results') + '</div>'
|
package/package.json
CHANGED
package/scripts/tags/index.js
CHANGED
|
@@ -22,6 +22,7 @@ hexo.extend.tag.register('sites', require('./lib/sites')(hexo))
|
|
|
22
22
|
hexo.extend.tag.register('ghcard', require('./lib/ghcard')(hexo))
|
|
23
23
|
hexo.extend.tag.register('toc', require('./lib/toc')(hexo))
|
|
24
24
|
hexo.extend.tag.register('timeline', require('./lib/timeline')(hexo), {ends: true})
|
|
25
|
+
hexo.extend.tag.register('md', require('./lib/md')(hexo))
|
|
25
26
|
|
|
26
27
|
// express
|
|
27
28
|
hexo.extend.tag.register('checkbox', require('./lib/checkbox')(hexo, 'checkbox'))
|
|
@@ -38,4 +39,6 @@ hexo.extend.tag.register('poetry', require('./lib/poetry')(hexo), true)
|
|
|
38
39
|
hexo.extend.tag.register('quot', require('./lib/quot')(hexo))
|
|
39
40
|
hexo.extend.tag.register('hashtag', require('./lib/hashtag')(hexo))
|
|
40
41
|
hexo.extend.tag.register('okr', require('./lib/okr')(hexo), {ends: true})
|
|
42
|
+
hexo.extend.tag.register('audio', require('./lib/audio')(hexo))
|
|
43
|
+
hexo.extend.tag.register('video', require('./lib/video')(hexo))
|
|
41
44
|
// others
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* audio.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% audio src %}
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
module.exports = ctx => function(args) {
|
|
12
|
+
args = ctx.args.map(args, ['type'], ['src'])
|
|
13
|
+
if (args.type == null) {
|
|
14
|
+
args.type = 'audio/mp3'
|
|
15
|
+
}
|
|
16
|
+
return `
|
|
17
|
+
<div class="tag-plugin audio">
|
|
18
|
+
<audio controls preload>
|
|
19
|
+
<source src="${args.src}" type="${args.type}">Your browser does not support the audio tag.
|
|
20
|
+
</audio>
|
|
21
|
+
</div>
|
|
22
|
+
`
|
|
23
|
+
}
|
package/scripts/tags/lib/grid.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* grid.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* {% grid [
|
|
6
|
-
* <!-- cell
|
|
5
|
+
* {% grid [bg:box/card] [w:240px] [c:2] [gap:16px] [br:12px] %}
|
|
6
|
+
* <!-- cell -->
|
|
7
7
|
* left body
|
|
8
|
-
* <!-- cell
|
|
8
|
+
* <!-- cell -->
|
|
9
9
|
* right body
|
|
10
10
|
* {% endgrid %}
|
|
11
11
|
*/
|
|
@@ -13,37 +13,37 @@
|
|
|
13
13
|
'use strict'
|
|
14
14
|
|
|
15
15
|
module.exports = ctx => function(args, content) {
|
|
16
|
-
args = ctx.args.map(args, ['bg'])
|
|
16
|
+
args = ctx.args.map(args, ['bg', 'w', 'c', 'gap', 'br'])
|
|
17
|
+
if (args.w == null && args.c == null) {
|
|
18
|
+
args.w = '240px'
|
|
19
|
+
}
|
|
17
20
|
var el = ''
|
|
18
21
|
el += '<div class="tag-plugin grid"'
|
|
19
|
-
el += ' ' + ctx.args.joinTags(args, ['bg']).join(' ')
|
|
22
|
+
el += ' ' + ctx.args.joinTags(args, ['bg', 'columns']).join(' ')
|
|
23
|
+
el += ' style="'
|
|
24
|
+
if (args.w) {
|
|
25
|
+
el += `grid-template-columns: repeat(auto-fill, minmax(${args.w}, 1fr));`
|
|
26
|
+
} else if (args.c) {
|
|
27
|
+
el += `grid-template-columns: repeat(${args.c}, 1fr);`
|
|
28
|
+
}
|
|
29
|
+
if (args.gap) {
|
|
30
|
+
el += `grid-gap:${args.gap};`
|
|
31
|
+
}
|
|
32
|
+
el += '"'
|
|
20
33
|
el += '>'
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
node.body = item
|
|
34
|
-
} else {
|
|
35
|
-
node.body += '\n' + item
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
nodes.forEach((node, i) => {
|
|
40
|
-
el += '<div class="cell" index="' + (i) + '">'
|
|
41
|
-
el += ctx.render.renderSync({text: (node.body || ''), engine: 'markdown'}).split('\n').join('')
|
|
42
|
-
el += '</div>'
|
|
43
|
-
})
|
|
34
|
+
// 分组
|
|
35
|
+
var cells = content.split(/<!--\s*cell(.*?)-->/g).filter(item => item.trim().length > 0)
|
|
36
|
+
for (let cell of cells) {
|
|
37
|
+
el += `<div class="cell" style="`
|
|
38
|
+
if (args.br) {
|
|
39
|
+
el += `border-radius:${args.br};`
|
|
40
|
+
}
|
|
41
|
+
el += `">`
|
|
42
|
+
el += `
|
|
43
|
+
${ctx.render.renderSync({text: (cell || ''), engine: 'markdown'}).split('\n').join('')}
|
|
44
|
+
</div>
|
|
45
|
+
`
|
|
44
46
|
}
|
|
45
|
-
|
|
46
47
|
el += '</div>'
|
|
47
|
-
|
|
48
48
|
return el
|
|
49
49
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* md.js v1.0 | https://github.com/volantis-x/hexo-theme-volantis/
|
|
3
|
+
* contributor: @MHuiG
|
|
4
|
+
*
|
|
5
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
6
|
+
*
|
|
7
|
+
* {% md src %}
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
'use strict'
|
|
11
|
+
|
|
12
|
+
var md_index = 0
|
|
13
|
+
|
|
14
|
+
module.exports = ctx => function(args) {
|
|
15
|
+
args = ctx.args.map(args, [''], ['src'])
|
|
16
|
+
const md_id = "md_" + ++md_index
|
|
17
|
+
return `
|
|
18
|
+
<div class="stellar-marked-api md-marked" src="${args.src}" id="${md_id}"></div>
|
|
19
|
+
`
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* video.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% video src %}
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
module.exports = ctx => function(args) {
|
|
12
|
+
args = ctx.args.map(args, ['type', 'bilibili', 'ratio'], ['src'])
|
|
13
|
+
if (args.bilibili) {
|
|
14
|
+
return `
|
|
15
|
+
<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16/9}">
|
|
16
|
+
<iframe src="https://player.bilibili.com/player.html?bvid=${args.bilibili}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true">
|
|
17
|
+
</iframe>
|
|
18
|
+
</div>
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
if (args.type == null) {
|
|
22
|
+
args.type = 'video/mp4'
|
|
23
|
+
}
|
|
24
|
+
return `
|
|
25
|
+
<div class="tag-plugin video">
|
|
26
|
+
<video controls preload>
|
|
27
|
+
<source src="${args.src}" type="${args.type}">Your browser does not support the video tag.
|
|
28
|
+
</video>
|
|
29
|
+
</div>
|
|
30
|
+
`
|
|
31
|
+
}
|
|
@@ -84,22 +84,16 @@
|
|
|
84
84
|
object-fit: cover
|
|
85
85
|
width: 100%
|
|
86
86
|
border-radius: 0
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
height: 240px
|
|
90
|
-
@media screen and (max-width: $device-tablet)
|
|
91
|
-
height: 220px
|
|
92
|
-
@media screen and (max-width: $device-mobile-425)
|
|
93
|
-
height: 200px
|
|
94
|
-
@media screen and (max-width: $device-mobile-375)
|
|
95
|
-
height: 180px
|
|
96
|
-
|
|
87
|
+
aspect-ratio: hexo-config('article.cover_ratio')
|
|
88
|
+
|
|
97
89
|
.post-list .post-card.post.photo
|
|
98
90
|
.cover
|
|
99
91
|
position: relative
|
|
100
92
|
line-height: 0
|
|
101
93
|
img
|
|
102
94
|
width: 100%
|
|
95
|
+
object-fit: cover
|
|
96
|
+
aspect-ratio: hexo-config('article.cover_ratio')
|
|
103
97
|
.cover-info
|
|
104
98
|
padding: 1.5rem 1rem
|
|
105
99
|
position: absolute
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
margin-bottom: .5em
|
|
9
9
|
position: relative
|
|
10
10
|
padding: 4px 0
|
|
11
|
-
color: var(--text-
|
|
11
|
+
color: var(--text-p1)
|
|
12
12
|
&:after
|
|
13
13
|
content: ""
|
|
14
14
|
position: absolute
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
right: 0
|
|
19
19
|
z-index: -1
|
|
20
20
|
border-radius: 4px
|
|
21
|
-
background:
|
|
21
|
+
background: $color-theme
|
|
22
22
|
a.post
|
|
23
23
|
display: inline-flex
|
|
24
24
|
align-items: baseline
|
|
@@ -34,13 +34,9 @@
|
|
|
34
34
|
color: var(--text-p4)
|
|
35
35
|
&:hover
|
|
36
36
|
border-bottom: 1px solid $color-theme
|
|
37
|
+
color: var(--text-p0)
|
|
37
38
|
time
|
|
38
39
|
color: $color-theme
|
|
39
|
-
&:hover
|
|
40
|
-
.archive-header
|
|
41
|
-
color: var(--text-p1)
|
|
42
|
-
&:after
|
|
43
|
-
background: $color-theme
|
|
44
40
|
|
|
45
41
|
|
|
46
42
|
|
|
@@ -60,8 +60,14 @@ details.folding[child=codeblock]>div.body
|
|
|
60
60
|
margin: 0
|
|
61
61
|
figcaption
|
|
62
62
|
display: none
|
|
63
|
+
span
|
|
64
|
+
background: var(--theme-block)
|
|
63
65
|
.code:before
|
|
64
66
|
content: none
|
|
67
|
+
.highlight+.highlight
|
|
68
|
+
border-top: 1px dashed var(--theme-border)
|
|
69
|
+
border-top-left-radius: 0
|
|
70
|
+
border-top-right-radius: 0
|
|
65
71
|
|
|
66
72
|
details.folding[child=iframe]
|
|
67
73
|
overflow: hidden
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
.tag-plugin.grid
|
|
2
2
|
display: grid
|
|
3
3
|
grid-gap: 16px
|
|
4
|
-
|
|
5
|
-
>.cell
|
|
6
|
-
p:first-child>strong:only-child
|
|
7
|
-
font-size: 1rem
|
|
8
|
-
>.cell>
|
|
4
|
+
&[bg]>.cell>
|
|
9
5
|
p
|
|
10
6
|
line-height: 1.5
|
|
11
7
|
:first-child
|
|
@@ -21,7 +17,7 @@
|
|
|
21
17
|
&[bg]>.cell
|
|
22
18
|
padding: 1rem
|
|
23
19
|
border-radius: $border-card
|
|
24
|
-
&[bg='
|
|
20
|
+
&[bg='box']>.cell
|
|
25
21
|
background: var(--block)
|
|
26
22
|
&[bg='card']>.cell
|
|
27
23
|
background: var(--card)
|
|
@@ -40,6 +40,13 @@
|
|
|
40
40
|
margin: 0
|
|
41
41
|
border: none
|
|
42
42
|
background: none
|
|
43
|
+
figcaption
|
|
44
|
+
span
|
|
45
|
+
background: var(--theme-block)
|
|
46
|
+
.highlight+.highlight
|
|
47
|
+
border-top: 1px dashed var(--theme-border)
|
|
48
|
+
border-top-left-radius: 0
|
|
49
|
+
border-top-right-radius: 0
|
|
43
50
|
|
|
44
51
|
.md-text .tag-plugin.note[child=tabs]
|
|
45
52
|
>.body
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.widgets .widget-wrapper.search
|
|
2
|
-
margin-top: 1rem
|
|
3
2
|
margin-bottom: 0
|
|
4
3
|
|
|
5
4
|
.search-wrapper
|
|
@@ -12,36 +11,21 @@
|
|
|
12
11
|
align-items: center
|
|
13
12
|
transition: 0.38s ease-out
|
|
14
13
|
z-index: 0
|
|
15
|
-
&:after
|
|
16
|
-
content: ''
|
|
17
|
-
position absolute
|
|
18
|
-
left: 0
|
|
19
|
-
right: 0
|
|
20
|
-
bottom: 0
|
|
21
|
-
height: 2px
|
|
22
|
-
border-radius: 4px
|
|
23
|
-
background: convert(hexo-config('style.gradient.search'))
|
|
24
|
-
background-size: 200%
|
|
25
|
-
animation: glow 10s linear infinite
|
|
26
|
-
@keyframes glow {
|
|
27
|
-
from {
|
|
28
|
-
background-position: 0%
|
|
29
|
-
}
|
|
30
|
-
to {
|
|
31
|
-
background-position: 200%
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
14
|
.search-input
|
|
35
15
|
width: 100%
|
|
36
16
|
padding: 0.5rem 0
|
|
37
|
-
line-height: 1
|
|
17
|
+
line-height: 1.5
|
|
38
18
|
box-sizing: border-box
|
|
39
19
|
font-family: $ff-body
|
|
20
|
+
font-size: $fs-13
|
|
40
21
|
color: var(--text-p0)
|
|
22
|
+
|
|
41
23
|
|
|
42
|
-
&.noresult
|
|
24
|
+
&.noresult[searching='true']
|
|
43
25
|
.search-icon
|
|
44
26
|
color: $c-red
|
|
27
|
+
.search-form
|
|
28
|
+
border: 1px solid $c-red
|
|
45
29
|
|
|
46
30
|
.search-no-result
|
|
47
31
|
display: none
|
|
@@ -88,22 +72,27 @@
|
|
|
88
72
|
|
|
89
73
|
|
|
90
74
|
|
|
91
|
-
.search-wrapper.noresult
|
|
75
|
+
.search-wrapper.noresult[searching='true']
|
|
92
76
|
.search-no-result
|
|
93
77
|
display: block
|
|
94
78
|
|
|
95
79
|
.widget-wrapper
|
|
96
80
|
.search-form
|
|
97
81
|
top: 0
|
|
98
|
-
background: var(--
|
|
82
|
+
background: var(--card)
|
|
83
|
+
border: 1px solid var(--block-border)
|
|
84
|
+
border-radius: $border-bar
|
|
99
85
|
.search-input
|
|
100
|
-
|
|
86
|
+
text-indent: 0.75rem
|
|
87
|
+
padding-right: 2rem
|
|
101
88
|
.search-icon
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
margin: 2px
|
|
90
|
+
position absolute
|
|
91
|
+
right: 0
|
|
105
92
|
pointer-events: none
|
|
106
93
|
color: var(--text-p2)
|
|
94
|
+
padding: 0.5rem
|
|
95
|
+
border-radius: 'calc(%s - 2px)' % $border-bar
|
|
107
96
|
|
|
108
97
|
#search-result,.search-no-result
|
|
109
98
|
margin-top: 1rem
|
|
@@ -5,35 +5,36 @@
|
|
|
5
5
|
position: absolute
|
|
6
6
|
top: 0
|
|
7
7
|
right: 0
|
|
8
|
-
padding:
|
|
9
|
-
opacity: 0
|
|
8
|
+
padding: 0px 0.5rem
|
|
10
9
|
font-weight: 700
|
|
11
|
-
|
|
10
|
+
visibility: hidden
|
|
12
11
|
border-bottom-left-radius: $border-bar
|
|
13
12
|
border-bottom-right-radius: $border-bar
|
|
14
|
-
background: var(--
|
|
13
|
+
background: var(--card)
|
|
15
14
|
display: block
|
|
16
15
|
cursor: pointer
|
|
17
|
-
margin-right:
|
|
16
|
+
margin-right: 4px
|
|
17
|
+
margin-top: 4px
|
|
18
|
+
border-radius: 'calc(%s - 4px)' % $border-block
|
|
18
19
|
|
|
19
20
|
.highlight:hover
|
|
20
21
|
.code:before
|
|
21
|
-
|
|
22
|
+
visibility: hidden
|
|
22
23
|
.copy-btn
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.highlight .code .copy-btn:hover
|
|
26
|
-
opacity: 1
|
|
24
|
+
visibility: visible
|
|
27
25
|
|
|
28
26
|
.highlight .code .copy-btn.success
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
background: $c-green
|
|
28
|
+
color: white
|
|
29
|
+
visibility: visible
|
|
31
30
|
|
|
32
31
|
.highlight .code .copy-btn.warning
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
background: $c-orange
|
|
33
|
+
color: white
|
|
34
|
+
visibility: visible
|
|
35
35
|
|
|
36
36
|
.md-text .folding[child=codeblock]
|
|
37
|
-
.
|
|
38
|
-
|
|
37
|
+
.code .copy-btn
|
|
38
|
+
z-index 1
|
|
39
|
+
margin-right: 1rem
|
|
39
40
|
border-radius: $border-bar
|
package/source/js/main.js
CHANGED
|
@@ -242,7 +242,7 @@ if (stellar.plugins.stellar) {
|
|
|
242
242
|
const els = document.getElementsByClassName('stellar-' + key + '-api');
|
|
243
243
|
if (els != undefined && els.length > 0) {
|
|
244
244
|
stellar.jQuery(() => {
|
|
245
|
-
if (key == 'timeline' || 'memos') {
|
|
245
|
+
if (key == 'timeline' || 'memos' || 'marked') {
|
|
246
246
|
stellar.loadScript(stellar.plugins.marked).then(function () {
|
|
247
247
|
stellar.loadScript(js, { defer: true });
|
|
248
248
|
});
|
|
@@ -362,7 +362,7 @@ if (stellar.search.service) {
|
|
|
362
362
|
}
|
|
363
363
|
path = stellar.config.root + path;
|
|
364
364
|
const filter = $inputArea.attr('data-filter') || '';
|
|
365
|
-
searchFunc(path, filter, 'search-input', 'search-result');
|
|
365
|
+
searchFunc(path, filter, 'search-wrapper', 'search-input', 'search-result');
|
|
366
366
|
});
|
|
367
367
|
$inputArea.keydown(function(e) {
|
|
368
368
|
if (e.which == 13) {
|
|
@@ -13,7 +13,7 @@ codeElementArr.forEach(code => {
|
|
|
13
13
|
|
|
14
14
|
codeCopyBtn.innerText = stellar.plugins.copycode.success_text
|
|
15
15
|
codeCopyBtn.classList.add('success')
|
|
16
|
-
hud.toast(stellar.plugins.copycode.toast)
|
|
16
|
+
hud.toast(stellar.plugins.copycode.toast, 2500)
|
|
17
17
|
setTimeout(() => {
|
|
18
18
|
codeCopyBtn.innerText = stellar.plugins.copycode.default_text
|
|
19
19
|
codeCopyBtn.classList.remove('success')
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const loadMarkdown = (cfg) => {
|
|
2
|
+
if (!window.fetch) {
|
|
3
|
+
cfg.el.innerHTML =
|
|
4
|
+
'<div style="font-size: 24px"><p>Your browser outdated. Please use the latest version of Chrome or Firefox!</p><p>您的浏览器版本过低,请使用最新版的 Chrome 或 Firefox 浏览器!</p></div>';
|
|
5
|
+
} else {
|
|
6
|
+
cfg.el.innerHTML =
|
|
7
|
+
'<div class="loading-wrap"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity=".3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg></div>';
|
|
8
|
+
fetch(cfg.src, { method: "GET" })
|
|
9
|
+
.then((resp) => {
|
|
10
|
+
return Promise.all([
|
|
11
|
+
resp.ok,
|
|
12
|
+
resp.status,
|
|
13
|
+
resp.text(),
|
|
14
|
+
resp.headers,
|
|
15
|
+
]);
|
|
16
|
+
})
|
|
17
|
+
.then(([ok, status, data, headers]) => {
|
|
18
|
+
if (ok) {
|
|
19
|
+
return {
|
|
20
|
+
ok,
|
|
21
|
+
status,
|
|
22
|
+
data,
|
|
23
|
+
headers,
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
throw new Error(JSON.stringify(json.error));
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
.then((resp) => {
|
|
30
|
+
let data = marked.parse(resp.data);
|
|
31
|
+
cfg.el.innerHTML = data;
|
|
32
|
+
})
|
|
33
|
+
.catch((error) => {
|
|
34
|
+
console.error(error);
|
|
35
|
+
cfg.el.innerHTML =
|
|
36
|
+
'<div class="loading-wrap error"><svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" d="M12 3L21 20H3L12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.5s" values="60;0"/></path><path stroke-dasharray="6" stroke-dashoffset="6" d="M12 10V14"><animate fill="freeze" attributeName="stroke-dashoffset" begin="0.6s" dur="0.2s" values="6;0"/></path></g><circle cx="12" cy="17" r="1" fill="currentColor" fill-opacity="0"><animate fill="freeze" attributeName="fill-opacity" begin="0.8s" dur="0.4s" values="0;1"/></circle></svg></div>';
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
$(function () {
|
|
42
|
+
const els = document.getElementsByClassName('stellar-marked-api');
|
|
43
|
+
for (var i = 0; i < els.length; i++) {
|
|
44
|
+
var cfg = new Object();
|
|
45
|
+
const el = els[i];
|
|
46
|
+
cfg.src = `${el.getAttribute('src')}?t=${new Date().getTime()}`;
|
|
47
|
+
cfg.el = el;
|
|
48
|
+
loadMarkdown(cfg);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// Pieter Robberechts <http://github.com/probberechts>
|
|
23
23
|
|
|
24
24
|
/*exported searchFunc*/
|
|
25
|
-
var searchFunc = function(path, filter, searchId, contentId) {
|
|
25
|
+
var searchFunc = function(path, filter, wrapperId, searchId, contentId) {
|
|
26
26
|
|
|
27
27
|
function getAllCombinations(keywords) {
|
|
28
28
|
var i, j, result = [];
|
|
@@ -43,6 +43,7 @@ var searchFunc = function(path, filter, searchId, contentId) {
|
|
|
43
43
|
var $input = document.getElementById(searchId);
|
|
44
44
|
if (!$input) { return; }
|
|
45
45
|
var $resultContent = document.getElementById(contentId);
|
|
46
|
+
var $wrapper = document.getElementById(wrapperId);
|
|
46
47
|
|
|
47
48
|
$input.addEventListener("input", function(){
|
|
48
49
|
var resultList = [];
|
|
@@ -50,8 +51,10 @@ var searchFunc = function(path, filter, searchId, contentId) {
|
|
|
50
51
|
.sort(function(a,b) { return b.split(" ").length - a.split(" ").length; });
|
|
51
52
|
$resultContent.innerHTML = "";
|
|
52
53
|
if (this.value.trim().length <= 0) {
|
|
54
|
+
$wrapper.setAttribute('searching', 'false');
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
57
|
+
$wrapper.setAttribute('searching', 'true');
|
|
55
58
|
// perform local searching
|
|
56
59
|
datas.forEach(function(data) {
|
|
57
60
|
if (!data.content?.trim().length) { return }
|