hexo-theme-shokax 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/_config.yml +12 -11
- package/eslint.config.mjs +55 -0
- package/layout/_partials/post/footer.pug +2 -1
- package/package.json +37 -24
- package/scripts/generaters/config.js +4 -1
- package/scripts/plugin/index.js +4 -2
- package/scripts/utils.js +1 -2
- package/source/css/_common/components/highlight/highlight.styl +2 -2
- package/source/css/_common/components/post/nav.styl +1 -0
- package/source/js/_app/components/tcomments.ts +1 -1
- package/source/js/_app/pjax/refresh.ts +8 -7
- package/source/js/_app/pjax/siteInit.ts +1 -0
package/_config.yml
CHANGED
@@ -234,16 +234,17 @@ summary:
|
|
234
234
|
# Value before `||` delimiter is the target permalink,
|
235
235
|
# secend value is the name of Font icon.
|
236
236
|
social:
|
237
|
-
|
237
|
+
github: https://github.com/yourname || github || "#191717"
|
238
|
+
#gitee: https://gitee.com/yourname || gitee || "#e60026"
|
238
239
|
#google: https://plus.google.com/yourname || google
|
239
240
|
#twitter: https://twitter.com/yourname || twitter || "#00aff0"
|
240
241
|
#zhihu: https://www.zhihu.com/people/yourname || zhihu || "#1e88e5"
|
241
242
|
#music: https://music.163.com/#/user/home?id=yourid || cloud-music || "#e60026"
|
242
243
|
#weibo: https://weibo.com/yourname || weibo || "#ea716e"
|
243
244
|
#about: https://about.me/yourname || address-card || "#3b5998"
|
244
|
-
#
|
245
|
+
#email: mailto:foo@xxx.com || envelope || "#55acd5"
|
245
246
|
#facebook: https://www.facebook.com/yourname || facebook
|
246
|
-
#
|
247
|
+
#stackoverflow: https://stackoverflow.com/ || stack-overflow
|
247
248
|
#youtube: https://youtube.com/yourname || youtube
|
248
249
|
#instagram: https://instagram.com/yourname || instagram
|
249
250
|
#skype: skype:yourname?call|chat || skype
|
@@ -370,13 +371,13 @@ vendors:
|
|
370
371
|
unpkg: https://unpkg.com
|
371
372
|
js:
|
372
373
|
pace: bytedance|pace/1.2.4/pace.min.js
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
#
|
379
|
-
#
|
374
|
+
# pjax: npm_webcache|theme-shokax-pjax@0.0.3/pjax.shokax.min.js
|
375
|
+
# anime: npm_webcache|theme-shokax-anime@0.0.6/anime.shokax.min.js
|
376
|
+
# lozad: npm_webcache|lozad@1.16.0/dist/lozad.min.js
|
377
|
+
# algolia: bytedance|algoliasearch/4.12.1/algoliasearch-lite.umd.min.js
|
378
|
+
# instantsearch: bytedance|instantsearch.js/4.39.0/instantsearch.production.min.js
|
379
|
+
# quicklink: npm_webcache|quicklink@2.3.0/dist/quicklink.umd.js
|
380
|
+
# mouse_firework: npm_webcache|mouse-firework@0.0.4/dist/index.umd.js
|
380
381
|
async_js:
|
381
382
|
fancybox: bytedance|??jquery/3.5.1/jquery.min.js,fancybox/3.5.7/jquery.fancybox.min.js,justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
|
382
383
|
copy_tex: npm_webcache|katex@0.16.7/dist/contrib/copy-tex.min.js
|
@@ -384,4 +385,4 @@ vendors:
|
|
384
385
|
katex: npm_webcache|katex@0.16.7/dist/katex.min.css
|
385
386
|
comment: css/comment.css
|
386
387
|
fancybox: npm_webcache|@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
|
387
|
-
justifiedGallery: npm_webcache|justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
|
388
|
+
justifiedGallery: npm_webcache|justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
|
@@ -0,0 +1,55 @@
|
|
1
|
+
export default [
|
2
|
+
{
|
3
|
+
files: ['*.ts', '*.tsx', '*.vue'],
|
4
|
+
languageOptions: {
|
5
|
+
parser: '@typescript-eslint/parser',
|
6
|
+
parserOptions: {
|
7
|
+
ecmaVersion: 2022
|
8
|
+
}
|
9
|
+
},
|
10
|
+
plugins: {
|
11
|
+
'@typescript-eslint': await import('@typescript-eslint/eslint-plugin'),
|
12
|
+
'vue': await import('eslint-plugin-vue')
|
13
|
+
},
|
14
|
+
rules: {
|
15
|
+
camelcase: 'off',
|
16
|
+
'n/no-callback-literal': 'off',
|
17
|
+
'@typescript-eslint/ban-types': 'off',
|
18
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
19
|
+
'@typescript-eslint/no-var-requires': 'off',
|
20
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
21
|
+
'prefer-const': 'off'
|
22
|
+
}
|
23
|
+
},
|
24
|
+
{
|
25
|
+
files: ['*.js', '*.jsx'],
|
26
|
+
languageOptions: {
|
27
|
+
ecmaVersion: 2022
|
28
|
+
},
|
29
|
+
env: {
|
30
|
+
browser: true,
|
31
|
+
commonjs: true,
|
32
|
+
es6: true,
|
33
|
+
node: true
|
34
|
+
},
|
35
|
+
extends: [
|
36
|
+
'standard'
|
37
|
+
],
|
38
|
+
rules: {
|
39
|
+
camelcase: 'off',
|
40
|
+
'n/no-callback-literal': 'off',
|
41
|
+
'prefer-const': 'off'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
{
|
45
|
+
files: ['*.vue'],
|
46
|
+
languageOptions: {
|
47
|
+
parserOptions: {
|
48
|
+
ecmaVersion: 2022
|
49
|
+
}
|
50
|
+
},
|
51
|
+
extends: [
|
52
|
+
'plugin:vue/vue3-recommended'
|
53
|
+
]
|
54
|
+
}
|
55
|
+
];
|
@@ -4,7 +4,8 @@ div(class="meta")
|
|
4
4
|
span(class="icon")
|
5
5
|
i(class="ic i-eye")
|
6
6
|
span 此文章已被阅读次数:
|
7
|
-
|
7
|
+
- var prefixedPath = post.path.startsWith('/') ? post.path : '/' + post.path
|
8
|
+
span(id="twikoo_visitors" class="waline-pageview-count" data-path=prefixedPath) 正在加载...
|
8
9
|
span(class="item")
|
9
10
|
span(class="icon")
|
10
11
|
i(class="ic i-calendar-check")
|
package/package.json
CHANGED
@@ -1,50 +1,50 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.4",
|
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",
|
7
7
|
"author": "zkz098",
|
8
8
|
"license": "AGPL-3.0-or-later",
|
9
|
-
"packageManager": "pnpm@
|
9
|
+
"packageManager": "pnpm@9.4.0",
|
10
10
|
"scripts": {
|
11
11
|
"test": "tsc --build --verbose",
|
12
12
|
"build": "cd ./scripts && tsc --build --verbose"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
|
-
"@types/fancybox": "^3.5.
|
16
|
-
"@types/jquery": "^3.5.
|
15
|
+
"@types/fancybox": "^3.5.7",
|
16
|
+
"@types/jquery": "^3.5.30",
|
17
17
|
"@types/js-yaml": "^4.0.9",
|
18
|
-
"@types/node": "^20.
|
18
|
+
"@types/node": "^20.14.8",
|
19
19
|
"@types/quicklink": "^2.3.4",
|
20
|
-
"@typescript-eslint/eslint-plugin": "^
|
21
|
-
"@typescript-eslint/parser": "^
|
22
|
-
"eslint": "^
|
20
|
+
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
21
|
+
"@typescript-eslint/parser": "^7.13.1",
|
22
|
+
"eslint": "^9.5.0",
|
23
23
|
"eslint-config-standard": "~17",
|
24
24
|
"eslint-plugin-import": "^2.29.1",
|
25
|
-
"eslint-plugin-n": "^
|
26
|
-
"eslint-plugin-promise": "^6.
|
27
|
-
"eslint-plugin-vue": "^9.
|
28
|
-
"typescript": "^5.
|
25
|
+
"eslint-plugin-n": "^17.9.0",
|
26
|
+
"eslint-plugin-promise": "^6.2.0",
|
27
|
+
"eslint-plugin-vue": "^9.26.0",
|
28
|
+
"typescript": "^5.5.2"
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@waline/client": "^3.
|
32
|
-
"vue": "^3.4.
|
33
|
-
"@algolia/client-search": "^4.
|
34
|
-
"algoliasearch": "4.
|
35
|
-
"esbuild": "^0.
|
36
|
-
"hexo": "7.
|
37
|
-
"hexo-fs": "^4.1.
|
31
|
+
"@waline/client": "^3.2.2",
|
32
|
+
"vue": "^3.4.30",
|
33
|
+
"@algolia/client-search": "^4.23.3",
|
34
|
+
"algoliasearch": "4.23.3",
|
35
|
+
"esbuild": "^0.21.5",
|
36
|
+
"hexo": "7.2.0",
|
37
|
+
"hexo-fs": "^4.1.3",
|
38
38
|
"hexo-pagination": "^3.0.0",
|
39
|
-
"hexo-util": "^3.
|
40
|
-
"instantsearch.js": "^4.
|
39
|
+
"hexo-util": "^3.3.0",
|
40
|
+
"instantsearch.js": "^4.72.1",
|
41
41
|
"js-yaml": "^4.1.0",
|
42
42
|
"mouse-firework": "^0.0.5",
|
43
43
|
"quicklink": "^2.3.0",
|
44
44
|
"theme-shokax-anime": "^0.0.6",
|
45
45
|
"theme-shokax-pjax": "^0.0.3",
|
46
|
-
"twikoo": "^1.6.
|
47
|
-
"unlazy": "^0.
|
46
|
+
"twikoo": "^1.6.36",
|
47
|
+
"unlazy": "^0.11.3",
|
48
48
|
"hexo-lightning-minify": "latest",
|
49
49
|
"hexo-algoliasearch": "latest",
|
50
50
|
"hexo-feed": "latest",
|
@@ -53,5 +53,18 @@
|
|
53
53
|
"engines": {
|
54
54
|
"node": ">=18.0.0"
|
55
55
|
},
|
56
|
-
"engineStrict": true
|
56
|
+
"engineStrict": true,
|
57
|
+
"pnpm": {
|
58
|
+
"overrides": {
|
59
|
+
"array-includes": "npm:@nolyfill/array-includes@latest",
|
60
|
+
"array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
|
61
|
+
"array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
|
62
|
+
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
|
63
|
+
"hasown": "npm:@nolyfill/hasown@latest",
|
64
|
+
"is-regex": "npm:@nolyfill/is-regex@latest",
|
65
|
+
"object.fromentries": "npm:@nolyfill/object.fromentries@latest",
|
66
|
+
"object.groupby": "npm:@nolyfill/object.groupby@latest",
|
67
|
+
"object.values": "npm:@nolyfill/object.values@latest"
|
68
|
+
}
|
69
|
+
}
|
57
70
|
}
|
@@ -39,7 +39,10 @@ hexo.extend.filter.register('before_generate', () => {
|
|
39
39
|
else {
|
40
40
|
hexo.theme.config.image_list = js_yaml_1.default.load(node_fs_1.default.readFileSync(path_1.default.join(__dirname, '../../_images.yml'), { encoding: 'utf-8' }));
|
41
41
|
}
|
42
|
-
if (
|
42
|
+
if (data.images_index && data.images_index.length > 0) {
|
43
|
+
hexo.theme.config.index_images = data.images_index;
|
44
|
+
}
|
45
|
+
else if (node_fs_1.default.existsSync(path_1.default.join(__dirname, '../../_images_index.yml'))) {
|
43
46
|
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' }));
|
44
47
|
}
|
45
48
|
else {
|
package/scripts/plugin/index.js
CHANGED
@@ -47,10 +47,12 @@ hexo.on('generateBefore', () => {
|
|
47
47
|
});
|
48
48
|
hexo.on('generateAfter', () => {
|
49
49
|
// 检查版本更新
|
50
|
-
fetch('https://
|
50
|
+
fetch('https://api.shokax.top/version/hexo', { headers: {
|
51
|
+
"User-Agent": "Mozilla/5.0 ShokaX Client (hexo-theme-shokax)"
|
52
|
+
} }).then((res) => {
|
51
53
|
res.json().then((resp) => {
|
52
54
|
try {
|
53
|
-
const latest = resp['
|
55
|
+
const latest = resp['version'];
|
54
56
|
const current = package_json_1.version.split('.');
|
55
57
|
let isOutdated = false;
|
56
58
|
for (let i = 0; i < Math.max(latest.length, current.length); i++) {
|
package/scripts/utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getVendorLink =
|
3
|
+
exports.getVendorLink = getVendorLink;
|
4
4
|
function getVendorLink(hexo, source) {
|
5
5
|
const VendorsCfg = hexo.theme.config.vendors;
|
6
6
|
const tagIdx = source.indexOf('|');
|
@@ -11,4 +11,3 @@ function getVendorLink(hexo, source) {
|
|
11
11
|
return source;
|
12
12
|
}
|
13
13
|
}
|
14
|
-
exports.getVendorLink = getVendorLink;
|
@@ -72,22 +72,23 @@ export const siteRefresh = (reload) => {
|
|
72
72
|
sideBarTab()
|
73
73
|
sidebarTOC()
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
})
|
75
|
+
import('../page/post').then(({ postBeauty }) => {
|
76
|
+
postBeauty()
|
77
|
+
})
|
79
78
|
|
79
|
+
const cpel = $dom('#copyright')
|
80
|
+
if (cpel) {
|
80
81
|
const comment = new IntersectionObserver((entries) => {
|
81
82
|
entries.forEach((entry) => {
|
82
83
|
if (entry.isIntersecting) {
|
83
84
|
if (__shokax_waline__) {
|
84
|
-
import('../components/comments').then(({
|
85
|
+
import('../components/comments').then(({walinePageview, walineComment}) => {
|
85
86
|
walinePageview()
|
86
87
|
walineComment()
|
87
88
|
})
|
88
89
|
}
|
89
90
|
if (__shokax_twikoo__) {
|
90
|
-
import('../components/tcomments').then(({
|
91
|
+
import('../components/tcomments').then(({twikooComment}) => {
|
91
92
|
twikooComment()
|
92
93
|
})
|
93
94
|
}
|
@@ -99,7 +100,7 @@ export const siteRefresh = (reload) => {
|
|
99
100
|
threshold: 0.2
|
100
101
|
})
|
101
102
|
|
102
|
-
comment.observe(
|
103
|
+
comment.observe(cpel)
|
103
104
|
}
|
104
105
|
|
105
106
|
lazyLoad()
|