hexo-theme-shokax 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- package/UsageRestrictions.md +1 -1
- package/_config.yml +11 -11
- package/languages/zh-HK.yml +1 -1
- package/layout/_partials/sidebar/overview.pug +5 -4
- package/package.json +2 -2
- package/scripts/filters/post.js +0 -10
- package/scripts/generaters/config.js +1 -1
- package/scripts/helpers/engine.js +1 -30
- package/scripts/tags/links.js +2 -2
- package/source/js/_app/page/common.js +1 -19
- package/source/js/_app/pjax/refresh.js +0 -1
package/UsageRestrictions.md
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
2. ShokaX 项目组不会制作收费版或高级版的项目,ShokaX及其子项目有且只有社区版 (仅为声明)
|
15
15
|
|
16
16
|
## 处理方式
|
17
|
-
如果您违反了上述使用限制和
|
17
|
+
如果您违反了上述使用限制和AGPLv3的任何规定,ShokaX 项目组保留采取以下措施之一或多个的权利:
|
18
18
|
- 发出警告通知并要求立即纠正违规行为;(根据`AGPLv3 八`)
|
19
19
|
- 暂停或终止您对 ShokaX 及其子项目的使用权限并取消GPLv3授予您的权利;(根据`AGPLv3 八`)
|
20
20
|
- 取消您获取 ShokaX 社区支持和进行协作的权利;(社区管理)
|
package/_config.yml
CHANGED
@@ -140,16 +140,16 @@ iconfont: "1832207_igi8uaupcus"
|
|
140
140
|
|
141
141
|
menu:
|
142
142
|
home: / || home
|
143
|
-
about:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
posts:
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
friends: /friends/ || heart
|
143
|
+
# about:
|
144
|
+
# default: / || user
|
145
|
+
# aboutsite: /about/ || user
|
146
|
+
# admiration: /admiration/ || coffee
|
147
|
+
# posts:
|
148
|
+
# default: / || feather
|
149
|
+
# archives: /archives/ || list-alt
|
150
|
+
# categories: /categories/ || th
|
151
|
+
# tags: /tags/ || tags
|
152
|
+
# friends: /friends/ || heart
|
153
153
|
|
154
154
|
# https://twikoo.js.org
|
155
155
|
twikoo:
|
@@ -224,7 +224,7 @@ summary:
|
|
224
224
|
# Value before `||` delimiter is the target permalink,
|
225
225
|
# secend value is the name of Font icon.
|
226
226
|
social:
|
227
|
-
github: https://github.com/name || github || "#191717"
|
227
|
+
# github: https://github.com/name || github || "#191717"
|
228
228
|
#google: https://plus.google.com/yourname || google
|
229
229
|
#twitter: https://twitter.com/yourname || twitter || "#00aff0"
|
230
230
|
#zhihu: https://www.zhihu.com/people/yourname || zhihu || "#1e88e5"
|
package/languages/zh-HK.yml
CHANGED
@@ -30,10 +30,11 @@ nav(class="state")
|
|
30
30
|
!= __('state.tags')
|
31
31
|
|
32
32
|
div(class="social")
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
if theme.social
|
34
|
+
each link, name in theme.social
|
35
|
+
- var sidebarURL = link.split('||')[0].trim()
|
36
|
+
- var sidebarIcon = '<i class="ic i-' + link.split('||')[1].trim() + '"></i>'
|
37
|
+
!= _url(sidebarURL, sidebarIcon, {title: sidebarURL, class: 'item ' + name})
|
37
38
|
|
38
39
|
!= shokax_inject('sidebar')
|
39
40
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.8",
|
4
4
|
"description": "a hexo theme based on shoka",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "https://github.com/theme-shoka-x/hexo-theme-shokaX",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"mocha": "^10.2.0",
|
36
36
|
"typescript": "^5.3.2",
|
37
37
|
"vue": "^3.3.9",
|
38
|
-
"jsdom": "^
|
38
|
+
"jsdom": "^23.0.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
41
|
"esbuild": "^0.19.7",
|
package/scripts/filters/post.js
CHANGED
@@ -1,13 +1,3 @@
|
|
1
1
|
hexo.extend.filter.register('after_post_render', (data) => {
|
2
|
-
const { config } = hexo;
|
3
2
|
data.content = data.content.replace(/(<img[^>]*) src=/img, '$1 data-src=');
|
4
|
-
const siteHost = new URL(config.url).hostname || config.url;
|
5
|
-
data.content = data.content.replace(/<a[^>]* href="([^"]+)"[^>]*>([^<]*)<\/a>/img, (match, href, html) => {
|
6
|
-
if (!href)
|
7
|
-
return match;
|
8
|
-
const link = new URL(href, config.url);
|
9
|
-
if (!link.protocol || link.hostname === siteHost)
|
10
|
-
return match;
|
11
|
-
return `<span class="exturl" data-url="${Buffer.from(href).toString('base64')}">${html}</span>`;
|
12
|
-
});
|
13
3
|
}, 0);
|
@@ -40,6 +40,6 @@ hexo.extend.filter.register('before_generate', () => {
|
|
40
40
|
hexo.theme.config.index_images = js_yaml_1.default.load(node_fs_1.default.readFileSync(path_1.default.join(__dirname, '../../_images_index.yml'), { encoding: 'utf-8' }));
|
41
41
|
}
|
42
42
|
else {
|
43
|
-
hexo.theme.config.index_images = [];
|
43
|
+
hexo.theme.config.index_images = data.index_images || [];
|
44
44
|
}
|
45
45
|
});
|
@@ -48,43 +48,14 @@ hexo.extend.helper.register('_url', function (path, text, options = {}) {
|
|
48
48
|
if (!path) {
|
49
49
|
return;
|
50
50
|
}
|
51
|
-
const { config } = this;
|
52
|
-
const data = new URL(path, hexo.config.url);
|
53
|
-
const siteHost = new URL(config.url).hostname || config.url;
|
54
|
-
const theme = hexo.theme.config;
|
55
|
-
let exturl = '';
|
56
51
|
let tag = 'a';
|
57
52
|
let attrs = { href: hexo_util_1.url_for.call(this, path), class: undefined, external: undefined, rel: undefined, 'data-url': undefined };
|
58
|
-
if (theme.exturl && data.protocol && data.hostname !== siteHost) {
|
59
|
-
tag = 'span';
|
60
|
-
exturl = 'exturl';
|
61
|
-
const encoded = Buffer.from(path).toString('base64');
|
62
|
-
attrs = {
|
63
|
-
class: exturl,
|
64
|
-
'data-url': encoded
|
65
|
-
};
|
66
|
-
}
|
67
53
|
for (const key in options) {
|
68
|
-
|
69
|
-
attrs[key] += ' ' + options[key];
|
70
|
-
}
|
71
|
-
else {
|
72
|
-
attrs[key] = options[key];
|
73
|
-
}
|
54
|
+
attrs[key] = options[key];
|
74
55
|
}
|
75
56
|
if (attrs.class && Array.isArray(attrs.class)) {
|
76
57
|
attrs.class = attrs.class.join(' ');
|
77
58
|
}
|
78
|
-
if (data.protocol && data.hostname !== siteHost) {
|
79
|
-
attrs.external = null;
|
80
|
-
if (!theme.exturl) {
|
81
|
-
attrs.rel = 'noopener';
|
82
|
-
attrs.target = '_blank';
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
attrs.rel = null;
|
86
|
-
}
|
87
|
-
}
|
88
59
|
return (0, hexo_util_1.htmlTag)(tag, attrs, decodeURI(text), false);
|
89
60
|
});
|
90
61
|
hexo.extend.helper.register('_image_url', function (img, path = '') {
|
package/scripts/tags/links.js
CHANGED
@@ -42,9 +42,9 @@ function linkGrid(args, content) {
|
|
42
42
|
result += `<div class="item" title="${item.owner || item.site}"${item.color}>`;
|
43
43
|
if (urlparam.protocol && urlparam.hostname !== siteHost) {
|
44
44
|
const durl = Buffer.from(item.url).toString('base64');
|
45
|
-
result += `<span class="
|
45
|
+
result += `<span class="image" data-url="${durl}" data-background-image="${item_image}"></span>
|
46
46
|
<div class="info">
|
47
|
-
<span class="
|
47
|
+
<span class="title" data-url="${durl}">${item.site}</span>
|
48
48
|
<p class="desc">${item.desc || item.url}</p>
|
49
49
|
</div></div>`;
|
50
50
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.cardActive = void 0;
|
4
4
|
const dom_1 = require("../library/dom");
|
5
5
|
const cardActive = () => {
|
6
6
|
if (!(0, dom_1.$dom)('.index.wrap')) {
|
@@ -43,21 +43,3 @@ const cardActive = () => {
|
|
43
43
|
});
|
44
44
|
};
|
45
45
|
exports.cardActive = cardActive;
|
46
|
-
const registerExtURL = () => {
|
47
|
-
dom_1.$dom.each('span.exturl', (element) => {
|
48
|
-
const link = document.createElement('a');
|
49
|
-
link.href = decodeURIComponent(window.atob(element.dataset.url).split('').map((c) => {
|
50
|
-
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
51
|
-
}).join(''));
|
52
|
-
link.rel = 'noopener external nofollow noreferrer';
|
53
|
-
link.target = '_blank';
|
54
|
-
link.className = element.className;
|
55
|
-
link.title = element.title || element.innerText;
|
56
|
-
link.innerHTML = element.innerHTML;
|
57
|
-
if (element.dataset.backgroundImage) {
|
58
|
-
link.dataset.backgroundImage = element.dataset.backgroundImage;
|
59
|
-
}
|
60
|
-
element.parentNode.replaceChild(link, element);
|
61
|
-
});
|
62
|
-
};
|
63
|
-
exports.registerExtURL = registerExtURL;
|
@@ -43,7 +43,6 @@ const siteRefresh = (reload) => {
|
|
43
43
|
(0, sidebar_1.menuActive)();
|
44
44
|
(0, sidebar_1.sideBarTab)();
|
45
45
|
(0, sidebar_1.sidebarTOC)();
|
46
|
-
(0, common_1.registerExtURL)();
|
47
46
|
(0, post_1.postBeauty)();
|
48
47
|
(0, tab_1.tabFormat)();
|
49
48
|
if (typeof player_1.mediaPlayer !== 'undefined') {
|