hexo-theme-volantis 5.8.1 → 6.0.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/CHANGELOG.md +5 -39
- package/_cdn.yml +449 -0
- package/_config.yml +155 -157
- package/languages/en.yml +9 -10
- package/languages/zh-CN.yml +11 -15
- package/languages/zh-TW.yml +10 -11
- package/layout/_meta/category.ejs +10 -5
- package/layout/_meta/counter.ejs +14 -17
- package/layout/_meta/tags.ejs +3 -0
- package/layout/_meta/walinecount.ejs +1 -1
- package/layout/_partial/article.ejs +14 -9
- package/layout/_partial/cover.ejs +4 -4
- package/layout/_partial/footer.ejs +1 -1
- package/layout/_partial/head.ejs +7 -18
- package/layout/_partial/header.ejs +6 -6
- package/layout/_partial/post.ejs +4 -4
- package/layout/_partial/scripts/_ctrl.ejs +43 -2
- package/layout/_partial/scripts/config.ejs +69 -0
- package/layout/_partial/scripts/global.ejs +136 -60
- package/layout/_partial/scripts/index.ejs +16 -23
- package/layout/_plugins/_page_plugins/artitalk/index.ejs +1 -1
- package/layout/_plugins/_page_plugins/bbtalk/index.ejs +1 -1
- package/layout/_plugins/_page_plugins/fcircle/index.ejs +9 -8
- package/layout/_plugins/_page_plugins/katex/index.ejs +3 -3
- package/layout/_plugins/_page_plugins/mathjax/index.ejs +1 -1
- package/layout/_plugins/aplayer/layout.ejs +31 -23
- package/layout/_plugins/aplayer/script.ejs +93 -65
- package/layout/_plugins/comments/artalk/script.ejs +31 -40
- package/layout/_plugins/comments/discuss/script.ejs +1 -1
- package/layout/_plugins/comments/disqusjs/script.ejs +2 -2
- package/layout/_plugins/comments/gitalk/script.ejs +1 -1
- package/layout/_plugins/comments/twikoo/script.ejs +1 -1
- package/layout/_plugins/comments/vssue/script.ejs +3 -3
- package/layout/_plugins/comments/waline/script.ejs +2 -2
- package/layout/_plugins/github-api/script.ejs +3 -3
- package/layout/_plugins/lazyload/script.ejs +1 -1
- package/layout/_plugins/nodewaves/script.ejs +1 -1
- package/layout/_plugins/pace/script.ejs +15 -0
- package/layout/_plugins/parallax/script.ejs +1 -1
- package/layout/_plugins/pjax/index.ejs +66 -11
- package/layout/_plugins/pjax/pdata.ejs +5 -5
- package/layout/_plugins/preload/script.ejs +2 -2
- package/layout/_plugins/rightmenus/layout.ejs +4 -4
- package/layout/_plugins/scrollreveal/script.ejs +2 -2
- package/layout/_plugins/search/script.ejs +11 -8
- package/layout/_plugins/swiper/script.ejs +2 -2
- package/layout/{_partial/scripts/toc.ejs → _plugins/toc/script.ejs} +40 -36
- package/layout/_widget/blogger.ejs +4 -4
- package/layout/_widget/webinfo.ejs +13 -14
- package/layout/friends.ejs +2 -2
- package/layout/layout.ejs +1 -15
- package/package.json +4 -4
- package/scripts/events/lib/cdn.js +206 -0
- package/scripts/events/lib/check-configuration.js +7 -7
- package/scripts/events/lib/check-environment.js +17 -17
- package/scripts/events/lib/config.js +0 -24
- package/scripts/events/lib/render-stylus.js +5 -5
- package/scripts/events/lib/stellar-tag-utils.js +2 -2
- package/scripts/filters/hexo-blog-encrypt-callback.js +44 -0
- package/scripts/filters/img.js +1 -1
- package/scripts/filters/replace.js +3 -3
- package/scripts/filters/z-lazyload.js +3 -5
- package/scripts/helpers/first-style.js +2 -2
- package/scripts/helpers/head/generate_seo.js +24 -10
- package/scripts/helpers/head/generate_title__keywords__description.js +28 -9
- package/scripts/helpers/related-posts.js +3 -3
- package/scripts/helpers/structured-data/lib/blogposting.js +1 -1
- package/scripts/helpers/structured-data/lib/breadcrumblist.js +1 -1
- package/scripts/helpers/structured-data/lib/config.js +1 -1
- package/scripts/helpers/structured-data/lib/website.js +1 -1
- package/scripts/helpers//346/226/207/347/253/240/346/216/250/350/215/220.js +184 -0
- package/scripts/tags/btn.js +2 -2
- package/scripts/tags/btns.js +3 -3
- package/scripts/tags/checkbox.js +6 -6
- package/scripts/tags/contributors.js +7 -7
- package/scripts/tags/dropmenu.js +8 -8
- package/scripts/tags/fancybox.js +6 -6
- package/scripts/tags/folding.js +5 -5
- package/scripts/tags/frame.js +3 -3
- package/scripts/tags/friends.js +8 -8
- package/scripts/tags/ghcard.js +7 -7
- package/scripts/tags/image.js +6 -6
- package/scripts/tags/inline-labels.js +6 -6
- package/scripts/tags/link.js +5 -5
- package/scripts/tags/md.js +4 -4
- package/scripts/tags/media.js +5 -5
- package/scripts/tags/note.js +12 -12
- package/scripts/tags/pandown.js +29 -29
- package/scripts/tags/site.js +4 -4
- package/scripts/tags/span.js +4 -4
- package/scripts/tags/table.js +2 -2
- package/scripts/tags/tabs.js +23 -23
- package/scripts/tags/timeline.js +5 -5
- package/source/css/_first/base_first.styl +1 -1
- package/source/css/_style/_layout/article.styl +43 -0
- package/source/css/_style/_layout/main.styl +1 -1
- package/source/css/_style/_layout/search.styl +206 -14
- package/source/css/_style/_plugins/index.styl +1 -3
- package/source/js/app.js +133 -160
- package/source/js/plugins/parallax.js +1 -1
- package/source/js/plugins/rightMenus.js +24 -20
- package/source/js/search/algolia.js +239 -0
- package/source/js/search/hexo.js +8 -2
- package/source/js/search/meilisearch.js +220 -0
- package/layout/_partial/scripts/_ctrl/cdnCtrl.ejs +0 -127
- package/layout/_partial/scripts/_ctrl/coverCtrl.ejs +0 -43
- package/layout/_plugins/analytics/LCCounter.ejs +0 -207
- package/layout/_plugins/pjax/animate.ejs +0 -31
- package/layout/_plugins/rightmenu/layout.ejs +0 -119
- package/scripts/helpers/revisioned.js +0 -167
- package/source/css/_style/_plugins/pjaxanimate.styl +0 -160
- package/source/js/plugins/rightMenu.js +0 -577
- /package/layout/{_partial/scripts/content-visibility-scroll-fix.ejs → _plugins/content-visibility/script.ejs} +0 -0
package/scripts/tags/fancybox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function renderImg(content) {
|
|
4
|
-
return `${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}`;
|
|
4
|
+
return `${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}`;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
function buidAlt(alt) {
|
|
@@ -14,8 +14,8 @@ function buidAlt(alt) {
|
|
|
14
14
|
|
|
15
15
|
function buidImgFancybox(content, group) {
|
|
16
16
|
let html = renderImg(content).trim();
|
|
17
|
-
if(html.startsWith('<p>') &&
|
|
18
|
-
html=html.substring(0, html.length-4).substring(3);
|
|
17
|
+
if (html.startsWith('<p>') && html.endsWith('</p>')) { // 去除无用的 p 标签包裹
|
|
18
|
+
html = html.substring(0, html.length - 4).substring(3);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
let imageTags = html.includes('image-caption') ? 'image' : undefined;
|
|
@@ -31,10 +31,10 @@ function buidImgFancybox(content, group) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function postFancybox(args, content) {
|
|
34
|
-
if(/::/g.test(args)){
|
|
34
|
+
if (/::/g.test(args)) {
|
|
35
35
|
args = args.join(' ').split('::');
|
|
36
36
|
}
|
|
37
|
-
else{
|
|
37
|
+
else {
|
|
38
38
|
args = args.join(' ').split(',');
|
|
39
39
|
}
|
|
40
40
|
const cls = args[0];
|
|
@@ -49,4 +49,4 @@ function postFancybox(args, content) {
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
hexo.extend.tag.register('gallery', postFancybox, {ends: true});
|
|
52
|
+
hexo.extend.tag.register('gallery', postFancybox, { ends: true });
|
package/scripts/tags/folding.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function postFolding(args, content) {
|
|
4
|
-
if(/::/g.test(args)){
|
|
4
|
+
if (/::/g.test(args)) {
|
|
5
5
|
args = args.join(' ').split('::');
|
|
6
6
|
}
|
|
7
|
-
else{
|
|
7
|
+
else {
|
|
8
8
|
args = args.join(' ').split(',');
|
|
9
9
|
}
|
|
10
10
|
let style = '';
|
|
@@ -18,17 +18,17 @@ function postFolding(args, content) {
|
|
|
18
18
|
if (style != undefined) {
|
|
19
19
|
return `<details ${style}><summary> ${title} </summary>
|
|
20
20
|
<div class='content'>
|
|
21
|
-
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
|
21
|
+
${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
|
22
22
|
</div>
|
|
23
23
|
</details>`;
|
|
24
24
|
}
|
|
25
25
|
return `<details><summary> ${title} </summary>
|
|
26
26
|
<div class='content'>
|
|
27
|
-
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
|
27
|
+
${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
|
28
28
|
</div>
|
|
29
29
|
</details>`;
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
hexo.extend.tag.register('folding', postFolding, {ends: true});
|
|
34
|
+
hexo.extend.tag.register('folding', postFolding, { ends: true });
|
package/scripts/tags/frame.js
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
// {% frame device | video=xxx | part=top %}
|
|
13
13
|
// {% frame device | video=xxx | part=bottom %}
|
|
14
14
|
// device: iphone11,
|
|
15
|
-
hexo.extend.tag.register('frame', function(args) {
|
|
16
|
-
if(/::/g.test(args)){
|
|
15
|
+
hexo.extend.tag.register('frame', function (args) {
|
|
16
|
+
if (/::/g.test(args)) {
|
|
17
17
|
args = args.join(' ').split('::');
|
|
18
18
|
}
|
|
19
|
-
else{
|
|
19
|
+
else {
|
|
20
20
|
args = args.join(' ').split(' | ');
|
|
21
21
|
}
|
|
22
22
|
// 所有支持的参数
|
package/scripts/tags/friends.js
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
hexo.extend.tag.register('friends', function(args) {
|
|
10
|
+
hexo.extend.tag.register('friends', function (args) {
|
|
11
11
|
args = hexo.args.map(args, ['only', 'not', 'repo', 'api']);
|
|
12
12
|
if (args.only) {
|
|
13
|
-
if(/::/g.test(args.only)){
|
|
13
|
+
if (/::/g.test(args.only)) {
|
|
14
14
|
args.only = args.only.split('::');
|
|
15
|
-
}else{
|
|
15
|
+
} else {
|
|
16
16
|
args.only = args.only.split(',');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
if (args.not) {
|
|
20
|
-
if(/::/g.test(args.not)){
|
|
20
|
+
if (/::/g.test(args.not)) {
|
|
21
21
|
args.not = args.not.split('::');
|
|
22
|
-
}else{
|
|
22
|
+
} else {
|
|
23
23
|
args.not = args.not.split(',');
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -39,10 +39,10 @@ hexo.extend.tag.register('friends', function(args) {
|
|
|
39
39
|
function groupHeader(group) {
|
|
40
40
|
var header = '<div class="group-header">';
|
|
41
41
|
if (group.title) {
|
|
42
|
-
header += hexo.render.renderSync({text: group.title, engine: 'markdown'}).split('\n').join('');
|
|
42
|
+
header += hexo.render.renderSync({ text: group.title, engine: 'markdown' }).split('\n').join('');
|
|
43
43
|
}
|
|
44
44
|
if (group.description) {
|
|
45
|
-
header += hexo.render.renderSync({text: group.description, engine: 'markdown'}).split('\n').join('');
|
|
45
|
+
header += hexo.render.renderSync({ text: group.description, engine: 'markdown' }).split('\n').join('');
|
|
46
46
|
}
|
|
47
47
|
header += '</div>';
|
|
48
48
|
return header;
|
|
@@ -72,7 +72,7 @@ hexo.extend.tag.register('friends', function(args) {
|
|
|
72
72
|
if (group.repo) {
|
|
73
73
|
el += '<div class="friendsjs-wrap"';
|
|
74
74
|
el += ' id="friends-api"';
|
|
75
|
-
el += ' api="' + (group.api || 'https://issues-api.
|
|
75
|
+
el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
|
|
76
76
|
el += '>';
|
|
77
77
|
el += '<div class="loading-wrap"><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><p></p></div>';
|
|
78
78
|
el += '<div class="group-body"></div>';
|
package/scripts/tags/ghcard.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
// {% ghcard volantis-x %}
|
|
8
8
|
// {% ghcard volantis-x/hexo-theme-volantis %}
|
|
9
|
-
hexo.extend.tag.register('ghcard', function(args) {
|
|
10
|
-
if(/::/g.test(args)){
|
|
9
|
+
hexo.extend.tag.register('ghcard', function (args) {
|
|
10
|
+
if (/::/g.test(args)) {
|
|
11
11
|
args = args.join(' ').split('::');
|
|
12
12
|
}
|
|
13
|
-
else{
|
|
13
|
+
else {
|
|
14
14
|
args = args.join(' ').split(',');
|
|
15
15
|
}
|
|
16
16
|
const path = args[0].trim();
|
|
@@ -20,10 +20,10 @@ hexo.extend.tag.register('ghcard', function(args) {
|
|
|
20
20
|
if (path.includes('/')) {
|
|
21
21
|
// is repo
|
|
22
22
|
const ps = path.split('/');
|
|
23
|
-
url += 'https://github-readme-stats.
|
|
23
|
+
url += 'https://github-readme-stats.xaoxuu.com/api/pin/?username=' + ps[0] + '&repo=' + ps[1];
|
|
24
24
|
} else {
|
|
25
25
|
// is user
|
|
26
|
-
url += 'https://github-readme-stats.
|
|
26
|
+
url += 'https://github-readme-stats.xaoxuu.com/api/?username=' + path;
|
|
27
27
|
}
|
|
28
28
|
if (args.length > 1) {
|
|
29
29
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -39,11 +39,11 @@ hexo.extend.tag.register('ghcard', function(args) {
|
|
|
39
39
|
return card;
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
hexo.extend.tag.register('ghcardgroup', function(args, content) {
|
|
42
|
+
hexo.extend.tag.register('ghcardgroup', function (args, content) {
|
|
43
43
|
let ret = '';
|
|
44
44
|
// wrap
|
|
45
45
|
ret += '<div class="ghcard-group">';
|
|
46
46
|
ret += content;
|
|
47
47
|
ret += '</div>';
|
|
48
48
|
return ret;
|
|
49
|
-
}, {ends: true});
|
|
49
|
+
}, { ends: true });
|
package/scripts/tags/image.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
// {% image url, bg=#eee %}
|
|
12
12
|
// {% image url, alt=haha, width=400px %}
|
|
13
13
|
// {% image url, alt=haha, width=400px, bg=#eee %}
|
|
14
|
-
hexo.extend.tag.register('image', function(args) {
|
|
15
|
-
if(/::/g.test(args)){
|
|
14
|
+
hexo.extend.tag.register('image', function (args) {
|
|
15
|
+
if (/::/g.test(args)) {
|
|
16
16
|
args = args.join(' ').split('::');
|
|
17
17
|
}
|
|
18
|
-
else{
|
|
18
|
+
else {
|
|
19
19
|
args = args.join(' ').split(',');
|
|
20
20
|
}
|
|
21
21
|
const url = args[0].trim();
|
|
@@ -74,11 +74,11 @@ hexo.extend.tag.register('image', function(args) {
|
|
|
74
74
|
|
|
75
75
|
// {% inlineimage url %}
|
|
76
76
|
// {% inlineimage url, height=22px %}
|
|
77
|
-
hexo.extend.tag.register('inlineimage', function(args) {
|
|
78
|
-
if(/::/g.test(args)){
|
|
77
|
+
hexo.extend.tag.register('inlineimage', function (args) {
|
|
78
|
+
if (/::/g.test(args)) {
|
|
79
79
|
args = args.join(' ').split('::');
|
|
80
80
|
}
|
|
81
|
-
else{
|
|
81
|
+
else {
|
|
82
82
|
args = args.join(' ').split(',');
|
|
83
83
|
}
|
|
84
84
|
const url = args[0].trim();
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
hexo.extend.tag.register('u', function(args) {
|
|
4
|
+
hexo.extend.tag.register('u', function (args) {
|
|
5
5
|
return `<u>${args.join(' ')}</u>`;
|
|
6
6
|
});
|
|
7
|
-
hexo.extend.tag.register('emp', function(args) {
|
|
7
|
+
hexo.extend.tag.register('emp', function (args) {
|
|
8
8
|
return `<emp>${args.join(' ')}</emp>`;
|
|
9
9
|
});
|
|
10
|
-
hexo.extend.tag.register('wavy', function(args) {
|
|
10
|
+
hexo.extend.tag.register('wavy', function (args) {
|
|
11
11
|
return `<wavy>${args.join(' ')}</wavy>`;
|
|
12
12
|
});
|
|
13
|
-
hexo.extend.tag.register('del', function(args) {
|
|
13
|
+
hexo.extend.tag.register('del', function (args) {
|
|
14
14
|
return `<del>${args.join(' ')}</del>`;
|
|
15
15
|
});
|
|
16
|
-
hexo.extend.tag.register('kbd', function(args) {
|
|
16
|
+
hexo.extend.tag.register('kbd', function (args) {
|
|
17
17
|
return `<kbd>${args.join(' ')}</kbd>`;
|
|
18
18
|
});
|
|
19
|
-
hexo.extend.tag.register('psw', function(args) {
|
|
19
|
+
hexo.extend.tag.register('psw', function (args) {
|
|
20
20
|
return `<psw>${args.join(' ')}</psw>`;
|
|
21
21
|
});
|
package/scripts/tags/link.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// {% link title, url %}
|
|
4
4
|
// {% link title, url, img %}
|
|
5
|
-
hexo.extend.tag.register('link', function(args) {
|
|
6
|
-
if(/::/g.test(args)){
|
|
5
|
+
hexo.extend.tag.register('link', function (args) {
|
|
6
|
+
if (/::/g.test(args)) {
|
|
7
7
|
args = args.join(' ').split('::');
|
|
8
8
|
}
|
|
9
|
-
else{
|
|
9
|
+
else {
|
|
10
10
|
args = args.join(' ').split(',');
|
|
11
11
|
}
|
|
12
12
|
let text = '';
|
|
@@ -36,10 +36,10 @@ hexo.extend.tag.register('link', function(args) {
|
|
|
36
36
|
return result;
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
hexo.extend.tag.register('linkgroup', function(args, content) {
|
|
39
|
+
hexo.extend.tag.register('linkgroup', function (args, content) {
|
|
40
40
|
let ret = '';
|
|
41
41
|
ret += '<div class="link-group">';
|
|
42
42
|
ret += content;
|
|
43
43
|
ret += '</div>';
|
|
44
44
|
return ret;
|
|
45
|
-
}, {ends: true});
|
|
45
|
+
}, { ends: true });
|
package/scripts/tags/md.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
hexo.extend.tag.register('md', function(args) {
|
|
3
|
-
const {config} = hexo;
|
|
2
|
+
hexo.extend.tag.register('md', function (args) {
|
|
3
|
+
const { config } = hexo;
|
|
4
4
|
const md_path = args[0].trim();
|
|
5
5
|
let md_id = "md-" + hexo.createUuid()
|
|
6
6
|
let mat = `
|
|
7
7
|
<div id="${md_id}" class="tag-md markdown-body"></div>
|
|
8
8
|
<script>
|
|
9
9
|
(()=>{
|
|
10
|
-
volantis.css("${hexo.theme.config.
|
|
10
|
+
volantis.css("${hexo.theme.config.cdn.markdown}");
|
|
11
11
|
const contentEl = document.getElementById("${md_id}");
|
|
12
12
|
const loadMarkdown = (url) => {
|
|
13
13
|
if (!window.fetch) {
|
|
@@ -48,7 +48,7 @@ hexo.extend.tag.register('md', function(args) {
|
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
volantis.js("${hexo.theme.config.
|
|
51
|
+
volantis.js("${hexo.theme.config.cdn.marked}").then(()=>{
|
|
52
52
|
loadMarkdown("${md_path}?t=" + new Date().getTime());
|
|
53
53
|
})
|
|
54
54
|
})();
|
package/scripts/tags/media.js
CHANGED
|
@@ -6,7 +6,7 @@ function postAudio(args) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function postVideo(args) {
|
|
9
|
-
const {config} = hexo;
|
|
9
|
+
const { config } = hexo;
|
|
10
10
|
const src = args[0].trim();
|
|
11
11
|
// m3u8 https://github.com/volantis-x/hexo-theme-volantis/issues/606
|
|
12
12
|
// 文件扩展名为 .m3u8
|
|
@@ -14,7 +14,7 @@ function postVideo(args) {
|
|
|
14
14
|
let video_id = `video-${hexo.createUuid()}`
|
|
15
15
|
return `<div clsss="video"><video id="${video_id}" controls loop="false" width="100%"></video></div>
|
|
16
16
|
<script>
|
|
17
|
-
volantis.js("${hexo.theme.config.
|
|
17
|
+
volantis.js("${hexo.theme.config.cdn.hlsjs}").then(()=>{
|
|
18
18
|
var video = document.getElementById('${video_id}');
|
|
19
19
|
if(Hls.isSupported()) {
|
|
20
20
|
var hls = new Hls();
|
|
@@ -30,10 +30,10 @@ function postVideo(args) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function postVideos(args, content) {
|
|
33
|
-
if(/::/g.test(args)){
|
|
33
|
+
if (/::/g.test(args)) {
|
|
34
34
|
args = args.join(' ').split('::');
|
|
35
35
|
}
|
|
36
|
-
else{
|
|
36
|
+
else {
|
|
37
37
|
args = args.join(' ').split(',');
|
|
38
38
|
}
|
|
39
39
|
var cls = args[0];
|
|
@@ -50,4 +50,4 @@ function postVideos(args, content) {
|
|
|
50
50
|
|
|
51
51
|
hexo.extend.tag.register('audio', postAudio);
|
|
52
52
|
hexo.extend.tag.register('video', postVideo);
|
|
53
|
-
hexo.extend.tag.register('videos', postVideos, {ends: true});
|
|
53
|
+
hexo.extend.tag.register('videos', postVideos, { ends: true });
|
package/scripts/tags/note.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
// {% note style, content %}
|
|
8
8
|
function postNote(args) {
|
|
9
|
-
if(/::/g.test(args)){
|
|
9
|
+
if (/::/g.test(args)) {
|
|
10
10
|
args = args.join(' ').split('::');
|
|
11
11
|
}
|
|
12
|
-
else{
|
|
12
|
+
else {
|
|
13
13
|
args = args.join(' ').split(',');
|
|
14
14
|
}
|
|
15
15
|
if (args.length > 1) {
|
|
16
16
|
const cls = args[0].trim();
|
|
17
17
|
const text = args[1].trim();
|
|
18
|
-
return `<div class="note ${cls}">${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')}</div>`;
|
|
18
|
+
return `<div class="note ${cls}">${hexo.render.renderSync({ text: text, engine: 'markdown' }).split('\n').join('')}</div>`;
|
|
19
19
|
} else if (args.length > 0) {
|
|
20
20
|
const text = args[0].trim();
|
|
21
|
-
return `<div class="note">${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')}</div>`;
|
|
21
|
+
return `<div class="note">${hexo.render.renderSync({ text: text, engine: 'markdown' }).split('\n').join('')}</div>`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -26,10 +26,10 @@ function postNote(args) {
|
|
|
26
26
|
// content
|
|
27
27
|
// {% endnoteblock %}
|
|
28
28
|
function postNoteBlock(args, content) {
|
|
29
|
-
if(/::/g.test(args)){
|
|
29
|
+
if (/::/g.test(args)) {
|
|
30
30
|
args = args.join(' ').split('::');
|
|
31
31
|
}
|
|
32
|
-
else{
|
|
32
|
+
else {
|
|
33
33
|
args = args.join(' ').split(',');
|
|
34
34
|
}
|
|
35
35
|
if (args.length < 1) {
|
|
@@ -42,7 +42,7 @@ function postNoteBlock(args, content) {
|
|
|
42
42
|
const title = args[1].trim();
|
|
43
43
|
ret += '<p><strong>' + title + '</strong></p>';
|
|
44
44
|
}
|
|
45
|
-
ret += hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('');
|
|
45
|
+
ret += hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('');
|
|
46
46
|
ret += '</div>';
|
|
47
47
|
return ret;
|
|
48
48
|
}
|
|
@@ -53,19 +53,19 @@ hexo.extend.tag.register('note', postNote);
|
|
|
53
53
|
// {% blocknote style, title %}
|
|
54
54
|
// content
|
|
55
55
|
// {% endblocknote %}
|
|
56
|
-
hexo.extend.tag.register('blocknote', postNoteBlock, {ends: true});
|
|
56
|
+
hexo.extend.tag.register('blocknote', postNoteBlock, { ends: true });
|
|
57
57
|
// 兼容 noteblock
|
|
58
|
-
hexo.extend.filter.register('before_post_render', function(data) {
|
|
59
|
-
data.content = data.content.replace(/{%\s+noteblock(.*)%}/g, (p,q)=>{
|
|
58
|
+
hexo.extend.filter.register('before_post_render', function (data) {
|
|
59
|
+
data.content = data.content.replace(/{%\s+noteblock(.*)%}/g, (p, q) => {
|
|
60
60
|
return `{% blocknote ${q} %}`
|
|
61
61
|
});
|
|
62
62
|
data.content = data.content.replace(/{%\s+endnoteblock\s+%}/g, '{% endblocknote %}');
|
|
63
63
|
return data;
|
|
64
64
|
});
|
|
65
65
|
// 兼容 noteblock 失败
|
|
66
|
-
hexo.extend.tag.register('noteblock', postNoteBlockDeprecated, {ends: true});
|
|
66
|
+
hexo.extend.tag.register('noteblock', postNoteBlockDeprecated, { ends: true });
|
|
67
67
|
function postNoteBlockDeprecated(args, content) {
|
|
68
|
-
|
|
68
|
+
throw new Error(`
|
|
69
69
|
==================================================================================
|
|
70
70
|
{% noteblock %} is deprecated. Use {% blocknote %} instead.
|
|
71
71
|
see: https://github.com/volantis-x/hexo-theme-volantis/issues/712
|
package/scripts/tags/pandown.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// {% pandown type, url, pwd, fname %}
|
|
4
|
-
hexo.extend.tag.register('pandown', function(args) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
4
|
+
hexo.extend.tag.register('pandown', function (args) {
|
|
5
|
+
if (/::/g.test(args)) {
|
|
6
|
+
args = args.join(' ').split('::');
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
args = args.join(' ').split(',');
|
|
10
|
+
}
|
|
11
|
+
let type = '';
|
|
12
|
+
let url = '';
|
|
13
|
+
let pwd = '';
|
|
14
|
+
let fname = '';
|
|
15
|
+
if (args.length < 4) {
|
|
16
|
+
return;
|
|
17
|
+
} else if (args[0].trim() === 'yun') {
|
|
18
|
+
return '<p>对不起,pandown-tags不支持自定义</p><br><p>Sorry, pandown-tags does not support customization</p>'
|
|
19
|
+
} else {
|
|
20
|
+
type = args[0].trim();
|
|
21
|
+
url = args[1].trim();
|
|
22
|
+
pwd = args[2].trim();
|
|
23
|
+
fname = args[3].trim();
|
|
24
|
+
}
|
|
25
|
+
let result = '';
|
|
26
|
+
// js
|
|
27
|
+
result += '<div class="tag pandown-tags">';
|
|
28
|
+
//pandown
|
|
29
|
+
result += '<pandown type="' + type + '" url="' + url + '" pwd="' + pwd + '" fname="' + fname + '"></pandown>'
|
|
30
|
+
//调用
|
|
31
|
+
result += '<script>volantis.js("https://unpkg.com/pandown").then(pandown)</script></div>'
|
|
32
|
+
return result;
|
|
33
33
|
});
|
package/scripts/tags/site.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
hexo.extend.tag.register('sites', function(args) {
|
|
10
|
+
hexo.extend.tag.register('sites', function (args) {
|
|
11
11
|
args = hexo.args.map(args, ['only', 'not', 'repo', 'api']);
|
|
12
12
|
if (args.only) {
|
|
13
13
|
args.only = args.only.split(',');
|
|
@@ -31,10 +31,10 @@ hexo.extend.tag.register('sites', function(args) {
|
|
|
31
31
|
function groupHeader(group) {
|
|
32
32
|
var header = '<div class="group-header">';
|
|
33
33
|
if (group.title) {
|
|
34
|
-
header += hexo.render.renderSync({text: group.title, engine: 'markdown'}).split('\n').join('');
|
|
34
|
+
header += hexo.render.renderSync({ text: group.title, engine: 'markdown' }).split('\n').join('');
|
|
35
35
|
}
|
|
36
36
|
if (group.description) {
|
|
37
|
-
header += hexo.render.renderSync({text: group.description, engine: 'markdown'}).split('\n').join('');
|
|
37
|
+
header += hexo.render.renderSync({ text: group.description, engine: 'markdown' }).split('\n').join('');
|
|
38
38
|
}
|
|
39
39
|
header += '</div>';
|
|
40
40
|
return header;
|
|
@@ -68,7 +68,7 @@ hexo.extend.tag.register('sites', function(args) {
|
|
|
68
68
|
if (group.repo) {
|
|
69
69
|
el += '<div class="sitesjs-wrap"';
|
|
70
70
|
el += ' id="sites-api"';
|
|
71
|
-
el += ' api="' + (group.api || 'https://issues-api.
|
|
71
|
+
el += ' api="' + (group.api || 'https://issues-api.xaoxuu.com') + '/v1/' + group.repo + '"';
|
|
72
72
|
el += '>';
|
|
73
73
|
el += '<div class="loading-wrap"><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><p></p></div>';
|
|
74
74
|
el += '<div class="group-body"></div>';
|
package/scripts/tags/span.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
function postP(args) {
|
|
4
|
-
if(/::/g.test(args)){
|
|
4
|
+
if (/::/g.test(args)) {
|
|
5
5
|
args = args.join(' ').split('::');
|
|
6
6
|
}
|
|
7
|
-
else{
|
|
7
|
+
else {
|
|
8
8
|
args = args.join(' ').split(',');
|
|
9
9
|
}
|
|
10
10
|
const p0 = args[0].trim();
|
|
@@ -12,10 +12,10 @@ function postP(args) {
|
|
|
12
12
|
return `<p class='p ${p0}'>${p1}</p>`;
|
|
13
13
|
}
|
|
14
14
|
function postSpan(args) {
|
|
15
|
-
if(/::/g.test(args)){
|
|
15
|
+
if (/::/g.test(args)) {
|
|
16
16
|
args = args.join(' ').split('::');
|
|
17
17
|
}
|
|
18
|
-
else{
|
|
18
|
+
else {
|
|
19
19
|
args = args.join(' ').split(',');
|
|
20
20
|
}
|
|
21
21
|
const p0 = args[0].trim();
|
package/scripts/tags/table.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
function postTable(args, content) {
|
|
12
12
|
let ret = '';
|
|
13
13
|
ret += '<div class="table">';
|
|
14
|
-
ret += hexo.render.renderSync({text: content, engine: 'markdown'});
|
|
14
|
+
ret += hexo.render.renderSync({ text: content, engine: 'markdown' });
|
|
15
15
|
ret += '</div>';
|
|
16
16
|
return ret;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
hexo.extend.tag.register('table', postTable, {ends: true});
|
|
19
|
+
hexo.extend.tag.register('table', postTable, { ends: true });
|
package/scripts/tags/tabs.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
function postTabs(args, content) {
|
|
8
8
|
var tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g;
|
|
9
9
|
|
|
10
|
-
if(/::/g.test(args)){
|
|
10
|
+
if (/::/g.test(args)) {
|
|
11
11
|
args = args.join(' ').split('::');
|
|
12
12
|
}
|
|
13
|
-
else{
|
|
13
|
+
else {
|
|
14
14
|
args = args.join(' ').split(',');
|
|
15
15
|
}
|
|
16
16
|
var tabName = args[0];
|
|
@@ -31,36 +31,36 @@ function postTabs(args, content) {
|
|
|
31
31
|
|
|
32
32
|
for (var i = 0; i < matches.length; i += 2) {
|
|
33
33
|
var tabParameters = matches[i].split('@');
|
|
34
|
-
var postContent
|
|
35
|
-
var tabCaption
|
|
36
|
-
var tabIcon
|
|
37
|
-
var tabHref
|
|
34
|
+
var postContent = matches[i + 1];
|
|
35
|
+
var tabCaption = tabParameters[0] || '';
|
|
36
|
+
var tabIcon = tabParameters[1] || '';
|
|
37
|
+
var tabHref = '';
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
// 兼容aplayer插件 https://github.com/volantis-x/hexo-theme-volantis/issues/575
|
|
41
|
-
var aplayerTag=0
|
|
42
|
-
var aplayerTagReg
|
|
43
|
-
if(/class="aplayer aplayer-tag-marker"/g.test(postContent)){
|
|
44
|
-
aplayerTag=aplayerTagReg.exec(postContent)[0]
|
|
45
|
-
postContent=postContent.replace(aplayerTagReg,"@aplayerTag@")
|
|
41
|
+
var aplayerTag = 0
|
|
42
|
+
var aplayerTagReg = /\<div.*class=\"aplayer aplayer-tag-marker\"(.|\n)*\<\/script\>/g
|
|
43
|
+
if (/class="aplayer aplayer-tag-marker"/g.test(postContent)) {
|
|
44
|
+
aplayerTag = aplayerTagReg.exec(postContent)[0]
|
|
45
|
+
postContent = postContent.replace(aplayerTagReg, "@aplayerTag@")
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// 兼容 gallery 标签
|
|
49
|
-
var fancyboxTag=0
|
|
49
|
+
var fancyboxTag = 0
|
|
50
50
|
var fancyboxTagReg = /\<div.*galleryFlag(.|\n)*\<\/span\>\<\/div\>\<\/div\>/g
|
|
51
|
-
if(/galleryFlag/g.test(postContent)) {
|
|
52
|
-
fancyboxTag=fancyboxTagReg.exec(postContent)[0]
|
|
53
|
-
postContent=postContent.replace(fancyboxTagReg,"@fancyboxTag@")
|
|
51
|
+
if (/galleryFlag/g.test(postContent)) {
|
|
52
|
+
fancyboxTag = fancyboxTagReg.exec(postContent)[0]
|
|
53
|
+
postContent = postContent.replace(fancyboxTagReg, "@fancyboxTag@")
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
postContent = hexo.render.renderSync({text: postContent, engine: 'markdown'}).trim();
|
|
56
|
+
postContent = hexo.render.renderSync({ text: postContent, engine: 'markdown' }).trim();
|
|
57
57
|
|
|
58
|
-
if(aplayerTag){
|
|
59
|
-
postContent=postContent.replace(/\<pre\>\<code\>.*@aplayerTag@.*\<\/code><\/pre>/,aplayerTag)
|
|
58
|
+
if (aplayerTag) {
|
|
59
|
+
postContent = postContent.replace(/\<pre\>\<code\>.*@aplayerTag@.*\<\/code><\/pre>/, aplayerTag)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
if(fancyboxTag){
|
|
63
|
-
postContent=postContent.replace(/.*@fancyboxTag@.*/,fancyboxTag)
|
|
62
|
+
if (fancyboxTag) {
|
|
63
|
+
postContent = postContent.replace(/.*@fancyboxTag@.*/, fancyboxTag)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
tabId += 1;
|
|
@@ -84,6 +84,6 @@ function postTabs(args, content) {
|
|
|
84
84
|
return `<div class="tabs" id="tab-${tabName.toLowerCase().split(' ').join('-')}">${tabNav + tabContent}</div>`;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
hexo.extend.tag.register('tabs', postTabs, {ends: true});
|
|
88
|
-
hexo.extend.tag.register('subtabs', postTabs, {ends: true});
|
|
89
|
-
hexo.extend.tag.register('subsubtabs', postTabs, {ends: true});
|
|
87
|
+
hexo.extend.tag.register('tabs', postTabs, { ends: true });
|
|
88
|
+
hexo.extend.tag.register('subtabs', postTabs, { ends: true });
|
|
89
|
+
hexo.extend.tag.register('subsubtabs', postTabs, { ends: true });
|
package/scripts/tags/timeline.js
CHANGED
|
@@ -13,23 +13,23 @@ function postTimeline(args, content) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function postTimenode(args, content) {
|
|
16
|
-
if(/::/g.test(args)){
|
|
16
|
+
if (/::/g.test(args)) {
|
|
17
17
|
args = args.join(' ').split('::');
|
|
18
18
|
}
|
|
19
|
-
else{
|
|
19
|
+
else {
|
|
20
20
|
args = args.join(' ').split(',');
|
|
21
21
|
}
|
|
22
22
|
var time = args[0];
|
|
23
|
-
return `<div class="timenode"><div class="meta"><p>${hexo.render.renderSync({text: time, engine: 'markdown'})}</p></div><div class="body">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}</div></div>`;
|
|
23
|
+
return `<div class="timenode"><div class="meta"><p>${hexo.render.renderSync({ text: time, engine: 'markdown' })}</p></div><div class="body">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</div></div>`;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
// {% timeline %}
|
|
28
28
|
// ... timenode ...
|
|
29
29
|
// {% endtimeline %}
|
|
30
|
-
hexo.extend.tag.register('timeline', postTimeline, {ends: true});
|
|
30
|
+
hexo.extend.tag.register('timeline', postTimeline, { ends: true });
|
|
31
31
|
|
|
32
32
|
// {% timenode time %}
|
|
33
33
|
// what happened
|
|
34
34
|
// {% endtimenode %}
|
|
35
|
-
hexo.extend.tag.register('timenode', postTimenode, {ends: true});
|
|
35
|
+
hexo.extend.tag.register('timenode', postTimenode, { ends: true });
|