hexo-theme-stellar 1.6.1 → 1.9.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/_config.yml +145 -34
- package/languages/zh-CN.yml +2 -2
- package/languages/zh-TW.yml +2 -2
- package/layout/404.ejs +1 -1
- package/layout/_partial/cover/index.ejs +12 -0
- package/layout/_partial/cover/post_cover.ejs +41 -0
- package/layout/_partial/{main/article → cover}/wiki_cover.ejs +1 -4
- package/layout/_partial/head.ejs +14 -2
- package/layout/_partial/main/article/article_footer.ejs +4 -4
- package/layout/_partial/main/post_list/paginator.ejs +2 -2
- package/layout/_partial/main/post_list/post_card.ejs +43 -5
- package/layout/_partial/main/post_list/wiki_card.ejs +2 -0
- package/layout/_partial/plugins/comments/giscus/layout.ejs +39 -0
- package/layout/_partial/plugins/comments/giscus/script.ejs +26 -0
- package/layout/_partial/plugins/comments/layout.ejs +1 -1
- package/layout/_partial/plugins/comments/valine/script.ejs +1 -1
- package/layout/_partial/plugins/comments/waline/layout.ejs +19 -0
- package/layout/_partial/plugins/comments/waline/script.ejs +22 -0
- package/layout/_partial/scripts/index.ejs +7 -1
- package/layout/_partial/sidebar/widgets/recent.ejs +5 -13
- package/layout/index.ejs +5 -2
- package/layout/layout.ejs +1 -1
- package/layout/mathjax.ejs +29 -0
- package/layout/page.ejs +1 -1
- package/layout/post.ejs +9 -2
- package/package.json +1 -1
- package/scripts/events/index.js +5 -7
- package/scripts/tags/grid.js +35 -0
- package/scripts/tags/image.js +21 -1
- package/scripts/tags/index.js +3 -0
- package/scripts/tags/lib/users.js +23 -0
- package/scripts/tags/note.js +7 -22
- package/scripts/tags/poetry.js +48 -0
- package/scripts/tags/quot.js +51 -0
- package/scripts/tags/{site.js → sites.js} +3 -0
- package/source/css/_common/base.styl +9 -0
- package/source/css/_common/cap.styl +1 -0
- package/source/css/_common/highlight.styl +15 -4
- package/source/css/_custom.styl +6 -5
- package/source/css/_layout/list.styl +65 -35
- package/source/css/_layout/main.styl +2 -2
- package/source/css/_layout/md.styl +38 -21
- package/source/css/_layout/pages/archives.styl +1 -0
- package/source/css/_layout/partial/article-footer.styl +0 -2
- package/source/css/_layout/partial/cover.styl +50 -10
- package/source/css/_layout/partial/footer.styl +6 -0
- package/source/css/_layout/partial/related.styl +1 -0
- package/source/css/_layout/sidebar/sidebar.styl +21 -6
- package/source/css/_layout/tag-plugins/folding.styl +3 -0
- package/source/css/_layout/tag-plugins/frame.styl +1 -1
- package/source/css/_layout/tag-plugins/image.styl +1 -2
- package/source/css/_layout/tag-plugins/inline-labels.styl +3 -0
- package/source/css/_layout/tag-plugins/poetry.styl +50 -0
- package/source/css/_layout/tag-plugins/quot.styl +82 -0
- package/source/css/_plugins/comments/utterances.styl +3 -0
- package/source/css/_plugins/comments/waline.styl +61 -0
- package/source/css/_plugins/fancybox.styl +5 -0
- package/source/css/_plugins/index.styl +4 -0
- package/source/js/main.js +60 -13
- package/source/js/plugins/friends.js +6 -5
- package/source/js/plugins/sites.js +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
function load_comment(){
|
|
3
|
+
if(!document.getElementById("waline_container"))return;
|
|
4
|
+
stellar.loadCSS('<%- theme.comments.waline.css %>');
|
|
5
|
+
stellar.loadScript('<%- theme.comments.waline.js %>', {defer:true}).then(function () {
|
|
6
|
+
const el = document.getElementById("waline_container");
|
|
7
|
+
var path = el.getAttribute('comment_id');
|
|
8
|
+
if (!path) {
|
|
9
|
+
path = decodeURI(window.location.pathname);
|
|
10
|
+
}
|
|
11
|
+
Waline.init(Object.assign(<%- JSON.stringify(theme.comments.waline) %>, {
|
|
12
|
+
el: '#waline_container',
|
|
13
|
+
path: path,
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
window.addEventListener('DOMContentLoaded', (event) => {
|
|
18
|
+
console.log('DOM fully loaded and parsed');
|
|
19
|
+
load_comment();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
</script>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
// required plugins (only load if needs)
|
|
105
105
|
stellar.plugins = {
|
|
106
|
-
jQuery: '<%- url_for(theme.plugins.jquery || "https://
|
|
106
|
+
jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>',
|
|
107
107
|
sitesjs: '<%- url_for(theme.plugins.sitesjs) %>',
|
|
108
108
|
friendsjs: '<%- url_for(theme.plugins.friendsjs) %>',
|
|
109
109
|
};
|
|
@@ -121,6 +121,12 @@
|
|
|
121
121
|
if ('<%- theme.plugins.preload.enable %>' == 'true') {
|
|
122
122
|
stellar.plugins.preload = Object.assign(<%- JSON.stringify(theme.plugins.preload) %>);
|
|
123
123
|
}
|
|
124
|
+
if ('<%- theme.plugins.fancybox.enable %>' == 'true') {
|
|
125
|
+
stellar.plugins.fancybox = Object.assign(<%- JSON.stringify(theme.plugins.fancybox) %>);
|
|
126
|
+
}
|
|
127
|
+
if ('<%- theme.plugins.heti.enable %>' == 'true') {
|
|
128
|
+
stellar.plugins.heti = Object.assign(<%- JSON.stringify(theme.plugins.heti) %>);
|
|
129
|
+
}
|
|
124
130
|
</script>
|
|
125
131
|
|
|
126
132
|
<!-- required -->
|
|
@@ -27,29 +27,21 @@ function layoutDiv() {
|
|
|
27
27
|
}
|
|
28
28
|
el += '<div class="widget-body fs14">';
|
|
29
29
|
arr.sort("updated", -1).limit(item.limit).each(function(post) {
|
|
30
|
-
el += '<div class="
|
|
31
|
-
el += '<a class="
|
|
32
|
-
el += '<div class="cap">';
|
|
33
|
-
el += '<time>' + date(post.updated, config.date_format) + '</time>';
|
|
30
|
+
el += '<div class="more-item">';
|
|
31
|
+
el += '<a class="title" href="' + url_for(post.link || post.path) + '">';
|
|
34
32
|
if (post.layout == 'wiki') {
|
|
35
33
|
el += '<span>';
|
|
36
34
|
let proj = theme.wiki.projects[post.wiki];
|
|
37
35
|
if (proj && proj.title) {
|
|
38
|
-
el += proj.title;
|
|
36
|
+
el += proj.title + __('symbol.colon');
|
|
39
37
|
} else if (post.wiki) {
|
|
40
|
-
el += post.wiki;
|
|
38
|
+
el += post.wiki + __('symbol.colon');
|
|
41
39
|
}
|
|
42
40
|
el += '</span>';
|
|
43
|
-
} else {
|
|
44
|
-
post.categories.limit(1).forEach((cat, i) => {
|
|
45
|
-
el += '<span>' + cat.name + '</span>';
|
|
46
|
-
});
|
|
47
41
|
}
|
|
48
|
-
el += '</div>';
|
|
49
|
-
el += '<span class="title">';
|
|
50
42
|
el += post.title || post.seo_title || post.wiki;
|
|
51
|
-
el += '</span>';
|
|
52
43
|
el += '</a>';
|
|
44
|
+
el += '</div>';
|
|
53
45
|
el += '';
|
|
54
46
|
});
|
|
55
47
|
el += '</div>';
|
package/layout/index.ejs
CHANGED
|
@@ -12,10 +12,13 @@ if (page.title && page.wiki) {
|
|
|
12
12
|
|
|
13
13
|
function layout_post_card(layout, post, content) {
|
|
14
14
|
var el = '';
|
|
15
|
+
var layout = layout;
|
|
16
|
+
if (layout == 'post' && post.cover != undefined && post.cover_info != undefined) {
|
|
17
|
+
layout += ' photo';
|
|
18
|
+
}
|
|
15
19
|
el += '<a class="post-card ' + layout + ' ' + scrollreveal() + '" href="' + url_for(post.link || post.path) + '">';
|
|
16
|
-
el += '<article class="md">';
|
|
17
20
|
el += content;
|
|
18
|
-
el += '</
|
|
21
|
+
el += '</a>';
|
|
19
22
|
return el;
|
|
20
23
|
}
|
|
21
24
|
|
package/layout/layout.ejs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang='<%- page.lang %>'>
|
|
3
3
|
<%- partial('_partial/head') %>
|
|
4
4
|
<body>
|
|
5
|
-
<%- partial('_partial/
|
|
5
|
+
<%- partial('_partial/cover/index') %>
|
|
6
6
|
<div class='l_body' id='start'>
|
|
7
7
|
<aside class='l_left' layout='<%- page.layout %>'>
|
|
8
8
|
<%- partial('_partial/sidebar/index') %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<% if (theme.plugins.mathjax.enable){ %>
|
|
2
|
+
<script type="text/x-mathjax-config">
|
|
3
|
+
MathJax.Hub.Config({
|
|
4
|
+
tex2jax: {
|
|
5
|
+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
|
6
|
+
processEscapes: true
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script type="text/x-mathjax-config">
|
|
12
|
+
MathJax.Hub.Config({
|
|
13
|
+
tex2jax: {
|
|
14
|
+
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script type="text/x-mathjax-config">
|
|
20
|
+
MathJax.Hub.Queue(function() {
|
|
21
|
+
var all = MathJax.Hub.getAllJax(), i;
|
|
22
|
+
for(i=0; i < all.length; i += 1) {
|
|
23
|
+
all[i].SourceElement().parentNode.className += ' has-jax';
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script type="text/javascript" src="<%- theme.plugins.mathjax.cdn %>"></script>
|
|
29
|
+
<% } %>
|
package/layout/page.ejs
CHANGED
|
@@ -10,7 +10,7 @@ function layoutTitle() {
|
|
|
10
10
|
%>
|
|
11
11
|
<% if (page.h1 || page.title || (page.content && page.content.length > 0)) { %>
|
|
12
12
|
<%- partial('_partial/main/navbar/breadcrumb') %>
|
|
13
|
-
<article class='content md <%- page.layout %><%- scrollreveal() %>'>
|
|
13
|
+
<article class='content md <%- page.layout %><%- page.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
|
14
14
|
<%- layoutTitle() %>
|
|
15
15
|
<% if (page.content && page.content.length > 0) { %>
|
|
16
16
|
<%- page.content %>
|
package/layout/post.ejs
CHANGED
|
@@ -13,10 +13,17 @@ function layoutTitle() {
|
|
|
13
13
|
return '';
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
let post = page;
|
|
17
|
+
let heti = '';
|
|
18
|
+
if (theme.plugins.heti && theme.plugins.heti.enable) {
|
|
19
|
+
heti = ' heti';
|
|
20
|
+
}
|
|
16
21
|
%>
|
|
17
|
-
<%
|
|
22
|
+
<% if (page.mathjax == true){ %>
|
|
23
|
+
<%- partial('mathjax') %>
|
|
24
|
+
<% } %>
|
|
18
25
|
<%- partial('_partial/main/navbar/breadcrumb') %>
|
|
19
|
-
<article class='content md <%- post.layout %><%- scrollreveal() %>'>
|
|
26
|
+
<article class='content<%- heti %> md <%- post.layout %><%- post.indent ? ' indent' : '' %><%- scrollreveal() %>'>
|
|
20
27
|
<%- layoutTitle() %>
|
|
21
28
|
<%- post.content %>
|
|
22
29
|
<%- partial('_partial/main/article/article_footer') %>
|
package/package.json
CHANGED
package/scripts/events/index.js
CHANGED
|
@@ -10,11 +10,9 @@ hexo.on('generateBefore', () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
hexo.on('ready', () => {
|
|
13
|
-
const { version } = require('../../package.json');
|
|
14
|
-
hexo.log.info(`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Repo: https://github.com/xaoxuu/hexo-theme-stellar/
|
|
19
|
-
=======================================================`);
|
|
13
|
+
const { version, homepage, repository } = require('../../package.json');
|
|
14
|
+
hexo.log.info(`Welcome to Stellar ${version}
|
|
15
|
+
DOCS ${homepage}
|
|
16
|
+
REPO ${repository.url}
|
|
17
|
+
`);
|
|
20
18
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* grid.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% grid [color:color] [child:codeblock/tabs] title %}
|
|
6
|
+
* body
|
|
7
|
+
* {% endgrid %}
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
hexo.extend.tag.register('grid', function(args, content) {
|
|
13
|
+
args = hexo.args.map(args, ['color', 'child'], ['title']);
|
|
14
|
+
const color = args.color;
|
|
15
|
+
const title = args.title;
|
|
16
|
+
var el = '';
|
|
17
|
+
const defaultColor = hexo.theme.config.tag_plugins.note.default_color;
|
|
18
|
+
if (!color && defaultColor) {
|
|
19
|
+
color = defaultColor;
|
|
20
|
+
}
|
|
21
|
+
// header
|
|
22
|
+
el += '<div class="tag-plugin note"';
|
|
23
|
+
el += ' ' + hexo.args.joinTags(args, ['color', 'child']).join(' ');
|
|
24
|
+
el += '>';
|
|
25
|
+
// title
|
|
26
|
+
if (title && title.length > 0) {
|
|
27
|
+
el += '<div class="title"><strong>' + title + '</strong></div>';
|
|
28
|
+
}
|
|
29
|
+
// content
|
|
30
|
+
el += '<div class="body">';
|
|
31
|
+
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
32
|
+
el += '</div></div>';
|
|
33
|
+
|
|
34
|
+
return el;
|
|
35
|
+
}, {ends: true});
|
package/scripts/tags/image.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
hexo.extend.tag.register('image', function(args) {
|
|
11
|
-
args = hexo.args.map(args, ['width', 'height', 'bg', 'download', 'padding'], ['src', 'alt']);
|
|
11
|
+
args = hexo.args.map(args, ['width', 'height', 'bg', 'download', 'padding', 'fancybox'], ['src', 'alt']);
|
|
12
12
|
var style = '';
|
|
13
13
|
if (args.width) {
|
|
14
14
|
style += 'width:' + args.width + ';';
|
|
@@ -16,12 +16,32 @@ hexo.extend.tag.register('image', function(args) {
|
|
|
16
16
|
if (args.height) {
|
|
17
17
|
style += 'height:' + args.height + ';';
|
|
18
18
|
}
|
|
19
|
+
// fancybox
|
|
20
|
+
var fancybox = false;
|
|
21
|
+
if (hexo.theme.config.plugins.fancybox && hexo.theme.config.plugins.fancybox.enable) {
|
|
22
|
+
// 主题配置
|
|
23
|
+
if (hexo.theme.config.tag_plugins.image && hexo.theme.config.tag_plugins.image.fancybox) {
|
|
24
|
+
fancybox = hexo.theme.config.tag_plugins.image.fancybox;
|
|
25
|
+
}
|
|
26
|
+
// 覆盖配置
|
|
27
|
+
if (args.fancybox && args.fancybox.length > 0) {
|
|
28
|
+
if (args.fancybox == 'true') {
|
|
29
|
+
fancybox = true;
|
|
30
|
+
} else if (args.fancybox == 'false') {
|
|
31
|
+
fancybox = false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
19
36
|
function img(src, alt, style) {
|
|
20
37
|
let img = '';
|
|
21
38
|
img += '<img src="' + src + '"';
|
|
22
39
|
if (alt) {
|
|
23
40
|
img += ' alt="' + alt + '"';
|
|
24
41
|
}
|
|
42
|
+
if (fancybox) {
|
|
43
|
+
img += ' fancybox="true"';
|
|
44
|
+
}
|
|
25
45
|
if (style.length > 0) {
|
|
26
46
|
img += ' style="' + style + '"';
|
|
27
47
|
}
|
package/scripts/tags/index.js
CHANGED
|
@@ -6,3 +6,6 @@ const postTabs = require('./lib/tabs')(hexo);
|
|
|
6
6
|
hexo.extend.tag.register('tabs', postTabs, true);
|
|
7
7
|
hexo.extend.tag.register('subtabs', postTabs, true);
|
|
8
8
|
hexo.extend.tag.register('subsubtabs', postTabs, true);
|
|
9
|
+
|
|
10
|
+
const users = require('./lib/users')(hexo);
|
|
11
|
+
hexo.extend.tag.register('users', users);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* users.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* {% users api:https://api.github.com/repos/xaoxuu/hexo-theme-stellar/contributors %}
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
module.exports = ctx => function(args) {
|
|
11
|
+
args = ctx.args.map(args, ['api']);
|
|
12
|
+
var el = '<div class="tag-plugin users-wrap">';
|
|
13
|
+
|
|
14
|
+
el += '<div class="friendsjs-wrap"';
|
|
15
|
+
el += ' id="friends-api"';
|
|
16
|
+
el += ' api="' + args.api + '"';
|
|
17
|
+
el += '>';
|
|
18
|
+
el += '<div class="group-body"></div>';
|
|
19
|
+
el += '</div>';
|
|
20
|
+
|
|
21
|
+
el += '</div>';
|
|
22
|
+
return el;
|
|
23
|
+
};
|
package/scripts/tags/note.js
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
* note.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* note:
|
|
6
5
|
* {% note [color:color] [title] content %}
|
|
7
|
-
*
|
|
8
|
-
* noteblock:
|
|
9
|
-
* {% noteblock [color:color] [child:codeblock/tabs] title %}
|
|
10
|
-
* markdown content
|
|
11
|
-
* {% endnoteblock %}
|
|
12
6
|
*/
|
|
13
7
|
|
|
14
8
|
'use strict';
|
|
15
9
|
|
|
16
|
-
function
|
|
10
|
+
hexo.extend.tag.register('note', function(args) {
|
|
11
|
+
args = hexo.args.map(args, ['color'], ['title', 'content']);
|
|
12
|
+
if (args.content == undefined || args.content.length <= 0) {
|
|
13
|
+
args.content = args.title;
|
|
14
|
+
args.title = '';
|
|
15
|
+
}
|
|
17
16
|
const color = args.color;
|
|
18
17
|
const title = args.title;
|
|
19
18
|
var el = '';
|
|
@@ -31,22 +30,8 @@ function outputNoteBlock(args, content) {
|
|
|
31
30
|
}
|
|
32
31
|
// content
|
|
33
32
|
el += '<div class="body">';
|
|
34
|
-
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
33
|
+
el += hexo.render.renderSync({text: args.content, engine: 'markdown'}).split('\n').join('');
|
|
35
34
|
el += '</div></div>';
|
|
36
35
|
|
|
37
36
|
return el;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
hexo.extend.tag.register('note', function(args) {
|
|
41
|
-
args = hexo.args.map(args, ['color'], ['title', 'content']);
|
|
42
|
-
if (args.content == undefined || args.content.length <= 0) {
|
|
43
|
-
args.content = args.title;
|
|
44
|
-
args.title = '';
|
|
45
|
-
}
|
|
46
|
-
return outputNoteBlock(args, args.content);
|
|
47
37
|
});
|
|
48
|
-
|
|
49
|
-
hexo.extend.tag.register('noteblock', function(args, content) {
|
|
50
|
-
args = hexo.args.map(args, ['color', 'child'], ['title']);
|
|
51
|
-
return outputNoteBlock(args, content);
|
|
52
|
-
}, {ends: true});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* poetry.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* poetry:
|
|
6
|
+
* {% poetry [align:center] [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', 'align', 'footer'], ['title']);
|
|
17
|
+
|
|
18
|
+
el += '<div class="tag-plugin poetry"';
|
|
19
|
+
if (args.align) {
|
|
20
|
+
el += ' align="' + args.align + '"';
|
|
21
|
+
}
|
|
22
|
+
el += '>';
|
|
23
|
+
if (args.title) {
|
|
24
|
+
el += '<div class="title">';
|
|
25
|
+
el += args.title;
|
|
26
|
+
el += '</div>';
|
|
27
|
+
}
|
|
28
|
+
if (args.author || args.date) {
|
|
29
|
+
el += '<div class="meta">';
|
|
30
|
+
if (args.author) {
|
|
31
|
+
el += '<span>' + args.author + '</span>';
|
|
32
|
+
}
|
|
33
|
+
if (args.date) {
|
|
34
|
+
el += '<span>' + args.date + '</span>';
|
|
35
|
+
}
|
|
36
|
+
el += '</div>';
|
|
37
|
+
}
|
|
38
|
+
el += '<div class="body">';
|
|
39
|
+
el += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
40
|
+
el += '</div>';
|
|
41
|
+
if (args.footer) {
|
|
42
|
+
el += '<div class="footer">';
|
|
43
|
+
el += args.footer;
|
|
44
|
+
el += '</div>';
|
|
45
|
+
}
|
|
46
|
+
el += '</div>';
|
|
47
|
+
return el;
|
|
48
|
+
}, {ends: true});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* quot.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
|
+
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
|
+
*
|
|
5
|
+
* quot:
|
|
6
|
+
* {% quot [el:h1] [icon:default] text %}
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
hexo.extend.tag.register('quot', function(args) {
|
|
13
|
+
var el = '';
|
|
14
|
+
args = hexo.args.map(args, ['el', 'icon'], ['text']);
|
|
15
|
+
if (!args.el) {
|
|
16
|
+
args.el = 'p';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var type = '';
|
|
20
|
+
if (args.icon && args.icon != 'square' && args.icon != 'quotes') {
|
|
21
|
+
type = ' type="icon"';
|
|
22
|
+
} else {
|
|
23
|
+
type = ' type="text"';
|
|
24
|
+
}
|
|
25
|
+
function content() {
|
|
26
|
+
if (!args.icon) {
|
|
27
|
+
return args.text;
|
|
28
|
+
}
|
|
29
|
+
var el = '';
|
|
30
|
+
const cfg = hexo.theme.config.tag_plugins.quot[args.icon];
|
|
31
|
+
if (cfg && cfg.prefix) {
|
|
32
|
+
el += '<img class="icon prefix" src="' + cfg.prefix + '" />';
|
|
33
|
+
}
|
|
34
|
+
el += args.text;
|
|
35
|
+
if (cfg && cfg.suffix) {
|
|
36
|
+
el += '<img class="icon suffix" src="' + cfg.suffix + '" />';
|
|
37
|
+
}
|
|
38
|
+
return el;
|
|
39
|
+
}
|
|
40
|
+
if (args.el.includes('h')) {
|
|
41
|
+
el += '<' + args.el + ' class="tag-plugin quot"' + type + ' id="' + args.text + '">';
|
|
42
|
+
el += '<a href="#' + args.text + '" class="headerlink" title="' + args.text + '"></a>';
|
|
43
|
+
el += content();
|
|
44
|
+
el += '</' + args.el + '>';
|
|
45
|
+
} else {
|
|
46
|
+
el += '<' + args.el + ' class="tag-plugin quot"' + type + '>';
|
|
47
|
+
el += content();
|
|
48
|
+
el += '</' + args.el + '>';
|
|
49
|
+
}
|
|
50
|
+
return el;
|
|
51
|
+
});
|
|
@@ -62,6 +62,9 @@ hexo.extend.tag.register('sites', function(args) {
|
|
|
62
62
|
}
|
|
63
63
|
if (groupId in sites) {
|
|
64
64
|
let group = sites[groupId];
|
|
65
|
+
if ((typeof group == 'object') && group.constructor == Array) {
|
|
66
|
+
group = {items: group};
|
|
67
|
+
}
|
|
65
68
|
if (group.title || group.description) {
|
|
66
69
|
el += groupHeader(group);
|
|
67
70
|
}
|
|
@@ -12,6 +12,15 @@ a
|
|
|
12
12
|
&:hover
|
|
13
13
|
color: $color-hover
|
|
14
14
|
|
|
15
|
+
// md > a
|
|
16
|
+
p, li
|
|
17
|
+
>a:not([class])
|
|
18
|
+
margin: 0 1px
|
|
19
|
+
padding: 4px
|
|
20
|
+
border-radius: 4px
|
|
21
|
+
&:hover
|
|
22
|
+
color: darken($color-hover, 10)
|
|
23
|
+
background: alpha($color-hover, 0.08)
|
|
15
24
|
|
|
16
25
|
hr
|
|
17
26
|
color: var(--text-meta)
|
|
@@ -10,7 +10,7 @@ code
|
|
|
10
10
|
border-radius: 4px
|
|
11
11
|
|
|
12
12
|
article.md .highlight
|
|
13
|
-
margin:
|
|
13
|
+
margin: var(--gap-p) 0
|
|
14
14
|
border-radius: $border-block
|
|
15
15
|
overflow: hidden
|
|
16
16
|
background: var(--block)
|
|
@@ -78,6 +78,17 @@ article.md .highlight
|
|
|
78
78
|
table:not([class])
|
|
79
79
|
border-collapse: collapse
|
|
80
80
|
|
|
81
|
+
|
|
82
|
+
article.md pre
|
|
83
|
+
>.caption
|
|
84
|
+
color: var(--text-p3)
|
|
85
|
+
>.hljs
|
|
86
|
+
padding: 1rem
|
|
87
|
+
border-radius: $border-block
|
|
88
|
+
border: 1px solid var(--block-border)
|
|
89
|
+
line-height: 1.5
|
|
90
|
+
box-sizing: border-box
|
|
91
|
+
|
|
81
92
|
article.md .highlight
|
|
82
93
|
.code
|
|
83
94
|
vertical-align: top
|
|
@@ -133,7 +144,7 @@ article.md .highlight
|
|
|
133
144
|
content: "Python"
|
|
134
145
|
&.php .code:before
|
|
135
146
|
content: "PHP"
|
|
136
|
-
&.rust .code:before
|
|
147
|
+
&.rust .code:before,&.rs .code:before
|
|
137
148
|
content: "Rust"
|
|
138
149
|
&.sql .code:before
|
|
139
150
|
content: "SQL"
|
|
@@ -143,8 +154,8 @@ article.md .highlight
|
|
|
143
154
|
content: "Makefile"
|
|
144
155
|
&.go .code:before
|
|
145
156
|
content: "Go"
|
|
146
|
-
&.typescript .code:before
|
|
147
|
-
content: "
|
|
157
|
+
&.typescript .code:before,&.ts .code:before
|
|
158
|
+
content: "TS"
|
|
148
159
|
|
|
149
160
|
|
|
150
161
|
|
package/source/css/_custom.styl
CHANGED
|
@@ -5,6 +5,7 @@ $color-theme = #1BCDFC
|
|
|
5
5
|
$color-link = #2196f3
|
|
6
6
|
$color-button = #1BCDFC
|
|
7
7
|
$color-hover = #ff5722
|
|
8
|
+
$color-highlight = #ff5722
|
|
8
9
|
$color-inner = #fff
|
|
9
10
|
$color-cat = #FF7844
|
|
10
11
|
$color-cat-hover = darken($color-cat, 20)
|
|
@@ -31,7 +32,7 @@ $dark-site-bg-mobile = black
|
|
|
31
32
|
|
|
32
33
|
// @font-face
|
|
33
34
|
// font-family: 'Dosis'
|
|
34
|
-
// src: url('https://
|
|
35
|
+
// src: url('https://fastly.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf')
|
|
35
36
|
// font-weight: normal
|
|
36
37
|
// font-style: normal
|
|
37
38
|
|
|
@@ -47,7 +48,7 @@ $fs-14 = .875rem
|
|
|
47
48
|
$fs-13 = .8125rem
|
|
48
49
|
$fs-12 = .75rem
|
|
49
50
|
|
|
50
|
-
$fs-h1 =
|
|
51
|
+
$fs-h1 = 1.75rem // 32px
|
|
51
52
|
$fs-h2 = 1.5rem // 24px
|
|
52
53
|
$fs-h3 = 1.375rem // 22px
|
|
53
54
|
$fs-h4 = 1.125rem // 18px
|
|
@@ -63,14 +64,14 @@ $border-image = 6px
|
|
|
63
64
|
// 可以动态变化的属性
|
|
64
65
|
:root
|
|
65
66
|
--width-left: 256px
|
|
66
|
-
--width-main:
|
|
67
|
+
--width-main: 720px
|
|
67
68
|
--gap-l: 16px
|
|
68
|
-
--gap-p:
|
|
69
|
+
--gap-p: .75rem // gap for paragraph
|
|
69
70
|
// desktop 2k or larger
|
|
70
71
|
@media screen and (min-width: $device-2k)
|
|
71
72
|
--gap-l: 32px
|
|
72
73
|
--width-left: 320px
|
|
73
|
-
--width-main:
|
|
74
|
+
--width-main: 780px
|
|
74
75
|
// desktop 4k or larger
|
|
75
76
|
@media screen and (min-width: $device-4k)
|
|
76
77
|
--width-main: 860px
|