hexo-theme-shokax 0.2.5 → 0.2.6
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/languages/en.yml +9 -9
- package/languages/zh-HK.yml +7 -0
- package/languages/zh-TW.yml +7 -0
- package/layout/_partials/head/head.pug +1 -1
- package/layout/_partials/layout.pug +41 -59
- package/layout/_partials/post/footer.pug +1 -1
- package/package.json +3 -3
- package/scripts/generaters/config.js +3 -3
- package/source/js/_app/library.js +12 -0
- package/source/js/_app/page.js +18 -27
package/languages/en.yml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
name: English
|
|
2
2
|
|
|
3
3
|
favicon:
|
|
4
|
-
show:
|
|
5
|
-
hide: (´Д`)
|
|
4
|
+
show: (●´3`●) Here we go again.
|
|
5
|
+
hide: (´Д`) It's a disaster!
|
|
6
6
|
|
|
7
7
|
title:
|
|
8
8
|
archive: Archive
|
|
9
9
|
category: Category
|
|
10
10
|
tag: Tag
|
|
11
11
|
all: All
|
|
12
|
-
not_found: Σ( ° △ °|||)︴404!
|
|
12
|
+
not_found: Σ( ° △ °|||)︴404! Nothing can be seen
|
|
13
13
|
category_in: Posted in category "%s"
|
|
14
14
|
tag_in: Posted with tag "%s"
|
|
15
15
|
archive_in: Posted on "%s"
|
|
@@ -22,13 +22,13 @@ menu:
|
|
|
22
22
|
tags: Tags
|
|
23
23
|
about: About
|
|
24
24
|
search: Search
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
updata:
|
|
28
|
-
statistics:
|
|
29
|
-
admiration: Appreciation
|
|
25
|
+
census: Blog Visits Statistics
|
|
26
|
+
aboutsite: About This Site
|
|
27
|
+
updata: Update Log
|
|
28
|
+
statistics: Statistics
|
|
29
|
+
admiration: Appreciation
|
|
30
30
|
friends: Friends
|
|
31
|
-
privacy: Privacy
|
|
31
|
+
privacy: Privacy Policy
|
|
32
32
|
|
|
33
33
|
sidebar:
|
|
34
34
|
overview: Overview
|
package/languages/zh-HK.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
- var yandexValid = theme?.seo?.yandex,baiduValid = theme?.seo?.baidu
|
|
3
3
|
- var siteTitle = config.title,noBaiduT = theme?.seo?.disable_baidu_transformation
|
|
4
4
|
- var feedLink = full_url_for("/feed.json")
|
|
5
|
-
- var tk= theme?.twikoo?.enable
|
|
5
|
+
- var tk= theme?.twikoo?.enable
|
|
6
6
|
- var wl = theme.waline.enable,gt=theme?.gitalk?.enable
|
|
7
7
|
meta(charset="UTF-8")
|
|
8
8
|
meta(name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2")
|
|
@@ -2,6 +2,10 @@ include ../_mixin/breadcrumb.pug
|
|
|
2
2
|
include ../_mixin/sidebar.pug
|
|
3
3
|
include ../_mixin/widgets.pug
|
|
4
4
|
|
|
5
|
+
- var ignores = []
|
|
6
|
+
if (theme.quicklink.ignores)
|
|
7
|
+
- ignores.push(theme.quicklink.ignores)
|
|
8
|
+
|
|
5
9
|
doctype html
|
|
6
10
|
html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'filter: grayscale(1);':'' )
|
|
7
11
|
head
|
|
@@ -67,65 +71,43 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
|
67
71
|
!= partial('_partials/footer.pug', {}, {cache: true})
|
|
68
72
|
- var ccIcon = '<i class="ic i-creative-commons"></i>'
|
|
69
73
|
- var ccText = theme.creative_commons.license.toUpperCase()
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if page.quiz
|
|
108
|
-
| quiz: {
|
|
109
|
-
!= `choice: \'${__('quiz.choice')}\',`
|
|
110
|
-
!= `multiple: \'${__('quiz.multiple')}\',`
|
|
111
|
-
!= `true_false: \'${__('quiz.true_false')}\',`
|
|
112
|
-
!= `essay: \'${__('quiz.essay')}\',`
|
|
113
|
-
!= `gap_fill: \'${__('quiz.gap_fill')}\',`
|
|
114
|
-
!= `mistake: \'${__('quiz.mistake')}\'`
|
|
115
|
-
| },
|
|
116
|
-
| ignores : [
|
|
117
|
-
| function(uri) {
|
|
118
|
-
| return uri.includes('#');
|
|
119
|
-
| },
|
|
120
|
-
| function(uri) {
|
|
121
|
-
| return new RegExp(LOCAL.path+"$").test(uri);
|
|
122
|
-
| }
|
|
123
|
-
if theme.quicklink.ignores
|
|
124
|
-
| ,
|
|
125
|
-
!= _safedump(theme.quicklink.ignores)
|
|
126
|
-
| ]
|
|
127
|
-
| };
|
|
128
|
-
</script>
|
|
74
|
+
script(data-config type="text/javascript").
|
|
75
|
+
var LOCAL = {
|
|
76
|
+
path: `#{_permapath(page.path)}`,
|
|
77
|
+
favicon: {
|
|
78
|
+
show: `#{__('favicon.show')}`,
|
|
79
|
+
hide: `#{__('favicon.hide')}`
|
|
80
|
+
},
|
|
81
|
+
search: {
|
|
82
|
+
placeholder: "!{__('search.placeholder')}",
|
|
83
|
+
empty: "!{__('search.empty')}",
|
|
84
|
+
stats: "!{__('search.stats')}"
|
|
85
|
+
},
|
|
86
|
+
valine: `#{page.valine ? _safedump(page.valine) : 'true'}`,
|
|
87
|
+
chart: `#{page.chart ? 'true' : 'false'}`,
|
|
88
|
+
copy_tex: `#{page.math ? 'true' : 'false'}`,
|
|
89
|
+
katex: `#{page.math ? 'true' : 'false'}`,
|
|
90
|
+
mermaid: `#{page.mermaid ? 'true' : 'false'}`,
|
|
91
|
+
audio: `#{_safedump(page.audio)}`,
|
|
92
|
+
fancybox: `#{page.fancybox !== false ? 'true' : 'false'}`,
|
|
93
|
+
nocopy: `#{page.nocopy ? 'true' : 'false'}`,
|
|
94
|
+
outime: `#{page.outime !== false ? 'true' : 'false'}`,
|
|
95
|
+
template: `#{__('outime.template')}`,
|
|
96
|
+
quiz: {
|
|
97
|
+
choice: `#{__('quiz.choice')}`,
|
|
98
|
+
multiple: `#{__('quiz.multiple')}`,
|
|
99
|
+
true_false: `#{__('quiz.true_false')}`,
|
|
100
|
+
essay: `#{__('quiz.essay')}`,
|
|
101
|
+
gap_fill: `#{__('quiz.gap_fill')}`,
|
|
102
|
+
mistake: `#{__('quiz.mistake')}`
|
|
103
|
+
},
|
|
104
|
+
ignores: [
|
|
105
|
+
(uri) => uri.includes('#'),
|
|
106
|
+
(uri) => new RegExp(LOCAL.path + '$').test(uri),
|
|
107
|
+
!{JSON.stringify(ignores)}
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
|
|
129
111
|
script(src="https://polyfill.alicdn.com/polyfill.min.js")
|
|
130
112
|
if theme.advVendors.enable
|
|
131
113
|
each i in _list_vendor_js()
|
|
@@ -11,7 +11,7 @@ div(class="meta")
|
|
|
11
11
|
!= __('post.edited')
|
|
12
12
|
time(title=__('post.modified') + __('symbol.colon') + full_date(post.updated) itemprop="dateModified" datetime=moment(post.updated).format())
|
|
13
13
|
!= date(post.updated)
|
|
14
|
-
if theme.waline.pageview && !theme.waline.enable
|
|
14
|
+
if theme.waline.pageview && !theme.waline.enable && !theme.twikoo.enable
|
|
15
15
|
script(type = "module" data-pjax).
|
|
16
16
|
import { pageviewCount } from 'https://unpkg.com/@waline/client/dist/pageview.mjs';
|
|
17
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hexo-theme-shokax",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
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",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@types/jquery": "^3.5.16",
|
|
20
20
|
"@types/js-yaml": "^4.0.5",
|
|
21
21
|
"@types/lozad": "^1.16.1",
|
|
22
|
-
"@types/node": "^
|
|
22
|
+
"@types/node": "^20.1.0",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
|
24
24
|
"@typescript-eslint/parser": "^5.59.0",
|
|
25
25
|
"@vuepress/client": "2.0.0-beta.61",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "^5.0.4",
|
|
40
40
|
"vue": "^3.2.47",
|
|
41
41
|
"vuepress": "2.0.0-beta.61",
|
|
42
|
-
"vuepress-plugin-sitemap2": "2.0.0-beta.
|
|
42
|
+
"vuepress-plugin-sitemap2": "2.0.0-beta.208"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"js-yaml": "^4.1.0",
|
|
@@ -3,20 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const hexo_util_1 =
|
|
6
|
+
const hexo_util_1 = require("hexo-util");
|
|
7
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
10
10
|
hexo.extend.filter.register('before_generate', () => {
|
|
11
11
|
if (hexo.config.theme_config) {
|
|
12
|
-
hexo.theme.config = hexo_util_1.
|
|
12
|
+
hexo.theme.config = (0, hexo_util_1.deepMerge)(hexo.theme.config, hexo.config.theme_config);
|
|
13
13
|
}
|
|
14
14
|
const data = hexo.locals.get('data');
|
|
15
15
|
if (data.languages) {
|
|
16
16
|
const { i18n } = hexo.theme;
|
|
17
17
|
const mergeLang = lang => {
|
|
18
18
|
if (data.languages[lang]) {
|
|
19
|
-
i18n.set(lang, hexo_util_1.
|
|
19
|
+
i18n.set(lang, (0, hexo_util_1.deepMerge)(i18n.get([lang]), data.languages[lang]));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
for (const lang of ['en', 'ja', 'zh-CN', 'zh-HK', 'zh-TW']) {
|
|
@@ -303,3 +303,15 @@ const pageScroll = function (target, offset, complete) {
|
|
|
303
303
|
};
|
|
304
304
|
anime(opt).play();
|
|
305
305
|
};
|
|
306
|
+
let inCloudFlare = true;
|
|
307
|
+
window.addEventListener('DOMContentLoaded', function () {
|
|
308
|
+
inCloudFlare = false;
|
|
309
|
+
});
|
|
310
|
+
if (document.readyState === 'loading') {
|
|
311
|
+
window.addEventListener('load', function () {
|
|
312
|
+
if (inCloudFlare) {
|
|
313
|
+
window.dispatchEvent(new Event('DOMContentLoaded'));
|
|
314
|
+
console.log('%c ☁️cloudflare patch ' + '%c running(rocket & minify)', 'color: white; background: #ff8c00; padding: 5px 3px;', 'padding: 4px;border:1px solid #ff8c00');
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
package/source/js/_app/page.js
CHANGED
|
@@ -2,35 +2,26 @@ const cardActive = function () {
|
|
|
2
2
|
if (!$dom('.index.wrap')) {
|
|
3
3
|
return;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (article.hasClass('show')
|
|
8
|
-
article.
|
|
5
|
+
const io = new IntersectionObserver(function (entries) {
|
|
6
|
+
entries.forEach(function (article) {
|
|
7
|
+
if (article.target.hasClass('show')) {
|
|
8
|
+
io.unobserve(article.target);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const io = new IntersectionObserver(function (entries) {
|
|
14
|
-
entries.forEach(function (article) {
|
|
15
|
-
if (article.target.hasClass('show')) {
|
|
10
|
+
else {
|
|
11
|
+
if (article.isIntersecting || article.intersectionRatio > 0) {
|
|
12
|
+
article.target.addClass('show');
|
|
16
13
|
io.unobserve(article.target);
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
if (article.isIntersecting || article.intersectionRatio > 0) {
|
|
20
|
-
article.target.addClass('show');
|
|
21
|
-
io.unobserve(article.target);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}, {
|
|
26
|
-
root: null,
|
|
27
|
-
threshold: [0.3]
|
|
28
|
-
});
|
|
29
|
-
$dom.each('.index.wrap article.item, .index.wrap section.item', function (article) {
|
|
30
|
-
io.observe(article);
|
|
15
|
+
}
|
|
31
16
|
});
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
}, {
|
|
18
|
+
root: null,
|
|
19
|
+
threshold: [0.3]
|
|
20
|
+
});
|
|
21
|
+
$dom.each('.index.wrap article.item, .index.wrap section.item', function (article) {
|
|
22
|
+
io.observe(article);
|
|
23
|
+
});
|
|
24
|
+
$dom('.index.wrap .item:first-child').addClass('show');
|
|
34
25
|
$dom.each('.cards .item', function (element, index) {
|
|
35
26
|
['mouseenter', 'touchstart'].forEach(function (item) {
|
|
36
27
|
element.addEventListener(item, function (event) {
|
|
@@ -50,7 +41,7 @@ const cardActive = function () {
|
|
|
50
41
|
const registerExtURL = function () {
|
|
51
42
|
$dom.each('span.exturl', function (element) {
|
|
52
43
|
const link = document.createElement('a');
|
|
53
|
-
link.href = decodeURIComponent(atob(element.dataset.url).split('').map(function (c) {
|
|
44
|
+
link.href = decodeURIComponent(window.atob(element.dataset.url).split('').map(function (c) {
|
|
54
45
|
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
|
55
46
|
}).join(''));
|
|
56
47
|
link.rel = 'noopener external nofollow noreferrer';
|
|
@@ -688,5 +679,5 @@ const siteInit = function () {
|
|
|
688
679
|
window.addEventListener('DOMContentLoaded', siteInit, {
|
|
689
680
|
passive: true
|
|
690
681
|
});
|
|
691
|
-
console.log('%c Theme.ShokaX v' + CONFIG.version + ' %c https://github.com/
|
|
682
|
+
console.log('%c Theme.ShokaX v' + CONFIG.version + ' %c https://github.com/theme-shoka-x/hexo-theme-shokaX ', 'color: white; background: #e9546b; padding:5px 0;', 'padding:4px;border:1px solid #e9546b;');
|
|
692
683
|
console.log('%c by kaitaku ' + '%c https://www.kaitaku.xyz', 'color: white; background: #00bfff; padding: 5px 3px;', 'padding: 4px;border:1px solid #00bfff');
|