hexo-theme-shokax 0.4.10 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- package/_config.yml +0 -1
- package/package.json +16 -19
- package/source/js/_app/components/sidebar.ts +3 -3
- package/source/js/_app/page/fancybox.ts +57 -55
- package/source/js/_app/player.ts +1 -1
- package/CONTRIBUTING.md +0 -58
package/_config.yml
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.12",
|
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",
|
@@ -16,23 +16,20 @@
|
|
16
16
|
"@types/jquery": "^3.5.30",
|
17
17
|
"@types/js-yaml": "^4.0.9",
|
18
18
|
"@types/katex": "^0.16.7",
|
19
|
-
"@types/node": "^
|
19
|
+
"@types/node": "^22.5.5",
|
20
20
|
"@types/quicklink": "^2.3.4",
|
21
|
-
"@typescript-eslint/eslint-plugin": "^
|
22
|
-
"@typescript-eslint/parser": "^
|
23
|
-
"eslint": "^9.
|
21
|
+
"@typescript-eslint/eslint-plugin": "^8.6.0",
|
22
|
+
"@typescript-eslint/parser": "^8.6.0",
|
23
|
+
"eslint": "^9.11.0",
|
24
24
|
"eslint-config-standard": "~17",
|
25
|
-
"eslint-plugin-
|
26
|
-
"
|
27
|
-
"eslint-plugin-promise": "^6.4.0",
|
28
|
-
"eslint-plugin-vue": "^9.27.0",
|
29
|
-
"typescript": "^5.5.3"
|
25
|
+
"eslint-plugin-vue": "^9.28.0",
|
26
|
+
"typescript": "^5.6.2"
|
30
27
|
},
|
31
28
|
"dependencies": {
|
32
|
-
"@algolia/client-search": "^
|
33
|
-
"@waline/client": "^3.3.
|
34
|
-
"algoliasearch": "
|
35
|
-
"esbuild": "^0.23.
|
29
|
+
"@algolia/client-search": "^5.5.3",
|
30
|
+
"@waline/client": "^3.3.2",
|
31
|
+
"algoliasearch": "5.5.3",
|
32
|
+
"esbuild": "^0.23.1",
|
36
33
|
"hexo": "^7.3.0",
|
37
34
|
"hexo-algoliasearch": "^2.0.1",
|
38
35
|
"hexo-feed": "^1.1.2",
|
@@ -40,16 +37,16 @@
|
|
40
37
|
"hexo-pagination": "^4.0.0",
|
41
38
|
"hexo-renderer-pug": "^3.0.0",
|
42
39
|
"hexo-util": "^3.3.0",
|
43
|
-
"instantsearch.js": "^4.
|
40
|
+
"instantsearch.js": "^4.74.1",
|
44
41
|
"js-yaml": "^4.1.0",
|
45
42
|
"katex": "^0.16.11",
|
46
|
-
"mouse-firework": "^0.0.
|
43
|
+
"mouse-firework": "^0.0.6",
|
47
44
|
"quicklink": "^2.3.0",
|
48
|
-
"theme-shokax-anime": "^0.0.
|
45
|
+
"theme-shokax-anime": "^0.0.7",
|
49
46
|
"theme-shokax-pjax": "^0.0.3",
|
50
|
-
"twikoo": "^1.6.
|
47
|
+
"twikoo": "^1.6.39",
|
51
48
|
"unlazy": "^0.11.3",
|
52
|
-
"vue": "^3.
|
49
|
+
"vue": "^3.5.7"
|
53
50
|
},
|
54
51
|
"engines": {
|
55
52
|
"node": ">=18.0.0"
|
@@ -124,7 +124,7 @@ export const sidebarTOC = () => {
|
|
124
124
|
while (!parent.matches('.contents')) {
|
125
125
|
if (parent.matches('li')) {
|
126
126
|
parent.addClass('active')
|
127
|
-
const t = document.
|
127
|
+
const t = document.getElementById(decodeURIComponent(parent.querySelector('a.toc-link').getAttribute('href').replace('#', '')))
|
128
128
|
if (t) {
|
129
129
|
t.addClass('active')
|
130
130
|
}
|
@@ -147,13 +147,13 @@ export const sidebarTOC = () => {
|
|
147
147
|
|
148
148
|
sections = sections.map((element, index) => {
|
149
149
|
const link = element.querySelector('a.toc-link')
|
150
|
-
const anchor = document.
|
150
|
+
const anchor = document.getElementById(decodeURI(link.getAttribute('href').replace('#', '')))
|
151
151
|
if (!anchor) return null
|
152
152
|
const alink = anchor.querySelector('a.anchor')
|
153
153
|
|
154
154
|
const anchorScroll = (event:MouseEvent) => {
|
155
155
|
event.preventDefault()
|
156
|
-
const target = document.
|
156
|
+
const target = document.getElementById(decodeURI((event.currentTarget as HTMLElement).getAttribute('href').replace('#', '')))
|
157
157
|
|
158
158
|
activeLock = index
|
159
159
|
pageScroll((target as HTMLElement), null, () => {
|
@@ -7,68 +7,70 @@ export const postFancybox = (p:string) => {
|
|
7
7
|
if (document.querySelector(p + ' .md img')) {
|
8
8
|
vendorCss('fancybox')
|
9
9
|
vendorCss('justifiedGallery')
|
10
|
-
vendorJs('jquery')
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
vendorJs('jquery', ()=>{
|
11
|
+
vendorJs('justifiedGallery',()=>{
|
12
|
+
vendorJs('fancybox', () => {
|
13
|
+
const q = jQuery.noConflict()
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
$dom.each(p + ' p.gallery', (element) => {
|
16
|
+
const box = document.createElement('div')
|
17
|
+
box.className = 'gallery'
|
18
|
+
box.setAttribute('data-height', String(element.getAttribute('data-height') || 220))
|
19
19
|
|
20
|
-
|
20
|
+
box.innerHTML = element.innerHTML.replace(/<br>/g, '')
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
element.parentNode.insertBefore(box, element)
|
23
|
+
element.remove()
|
24
|
+
})
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
26
|
+
$dom.each(p + ' .md img:not(.emoji):not(.vemoji)', (element) => {
|
27
|
+
const $image = q(element)
|
28
|
+
const imageLink = $image.attr('data-src') || $image.attr('src') // 替换
|
29
|
+
const $imageWrapLink = $image.wrap('<a class="fancybox" href="' + imageLink + '" itemscope itemtype="https://schema.org/ImageObject" itemprop="url"></a>').parent('a')
|
30
|
+
let info; let captionClass = 'image-info'
|
31
|
+
if (!$image.is('a img')) {
|
32
|
+
$image.data('safe-src', imageLink)
|
33
|
+
if (!$image.is('.gallery img')) {
|
34
|
+
$imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default')
|
35
|
+
} else {
|
36
|
+
captionClass = 'jg-caption'
|
37
|
+
}
|
38
|
+
}
|
39
|
+
if ((info = element.getAttribute('title'))) {
|
40
|
+
$imageWrapLink.attr('data-caption', info)
|
41
|
+
const para = document.createElement('span')
|
42
|
+
const txt = document.createTextNode(info)
|
43
|
+
para.appendChild(txt)
|
44
|
+
para.addClass(captionClass)
|
45
|
+
insertAfter(element, para)
|
46
|
+
}
|
47
|
+
})
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
$dom.each(p + ' div.gallery', (el, i) => {
|
50
|
+
// @ts-ignore
|
51
|
+
q(el).justifiedGallery({
|
52
|
+
rowHeight: q(el).data('height') || 120,
|
53
|
+
rel: 'gallery-' + i
|
54
|
+
}).on('jg.complete', function () {
|
55
|
+
q(this).find('a').each((k, ele) => {
|
56
|
+
ele.setAttribute('data-fancybox', 'gallery-' + i)
|
57
|
+
})
|
58
|
+
})
|
57
59
|
})
|
58
|
-
})
|
59
|
-
})
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
61
|
+
q.fancybox.defaults.hash = false
|
62
|
+
q(p + ' .fancybox').fancybox({
|
63
|
+
loop: true,
|
64
|
+
// @ts-ignore
|
65
|
+
helpers: {
|
66
|
+
overlay: {
|
67
|
+
locked: false
|
68
|
+
}
|
69
|
+
}
|
70
|
+
})
|
71
|
+
// @ts-ignore
|
72
|
+
}, window.jQuery)
|
70
73
|
})
|
71
|
-
|
72
|
-
}, window.jQuery)
|
74
|
+
})
|
73
75
|
}
|
74
76
|
}
|
package/source/js/_app/player.ts
CHANGED
@@ -476,7 +476,7 @@ export const mediaPlayer = (t, config?) => {
|
|
476
476
|
fetch () {
|
477
477
|
return new Promise<boolean>((resolve, reject) => {
|
478
478
|
if (playlist.data.length > 0) {
|
479
|
-
resolve(
|
479
|
+
resolve(false)
|
480
480
|
} else {
|
481
481
|
if (this.options.rawList) {
|
482
482
|
const promises = []
|
package/CONTRIBUTING.md
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# Contributing for hexo-theme-shokaX
|
2
|
-
|
3
|
-
---
|
4
|
-
> 请在贡献前仔细阅读本文档
|
5
|
-
|
6
|
-
目录:
|
7
|
-
1. [代码贡献指南](#代码贡献指南)
|
8
|
-
2. [翻译贡献指南](#翻译贡献指南)
|
9
|
-
3. [最后需要注意的事项](#最后需要注意的事项)
|
10
|
-
|
11
|
-
# 代码贡献指南
|
12
|
-
## 前言
|
13
|
-
在提交代码之前,我们默认以下几点:
|
14
|
-
1. 您同意我们在未来进行授权许可更改时包含您所贡献的代码
|
15
|
-
2. 您有对于 shokaX 所使用的相关技术和 github PR 及 actions 的基础了解
|
16
|
-
|
17
|
-
有关提交的说明:
|
18
|
-
1. 您在提交时的`commit message`应描述其改动
|
19
|
-
2. 如果您提交的代码中包括图片资源,建议使用`webp`或`avif`格式
|
20
|
-
3. 条件允许的情况下代码应当附有注释以便维护
|
21
|
-
|
22
|
-
有关审查(Review)的说明:
|
23
|
-
1. 您在 PR 时应打开允许维护者修改 PR,以便我们进行修改
|
24
|
-
2. 您愿意接受长时间的等待(一般不超过15天)
|
25
|
-
3. 您能够接受因代码质量等问题而提出的疑问,并愿意讨论是否接受更改
|
26
|
-
|
27
|
-
有关issues的说明:
|
28
|
-
1. 如果您愿意开发某 issues 的提议功能或修复 bug,建议在对应 issue 下评论说明一下,避免闭门造车和重复造轮子的惨剧
|
29
|
-
2. 您应该在对应 PR 提交时绑定对应 issue,以便进行统计
|
30
|
-
|
31
|
-
## Github PR
|
32
|
-
此处为在使用 Github PR 提交时应注意的事:
|
33
|
-
- 默认你对 Git、GitHub 已经有了一定的了解,并且懂得使用 PR(此方面问题可以去讨论区发起 Q&A)
|
34
|
-
- 请提交 PR 至 main 分支
|
35
|
-
- PR 标题应简要明了地描述改动
|
36
|
-
- 未完工的代码仍可提交 PR,可以先设置为 Draft
|
37
|
-
- 善用相关词语填写 PR 信息或 Commit 信息,如提交、更新/修改、删除
|
38
|
-
- 请确保您所提交的代码可以正常运行
|
39
|
-
- 如果 PR 中删除了没有替代的代码,请注明删除原因
|
40
|
-
|
41
|
-
# 翻译贡献指南
|
42
|
-
在提交代码之前,我们默认以下几点:
|
43
|
-
1. 您同意我们在未来进行授权许可更改时包含您所贡献的翻译
|
44
|
-
2. 您有对于 shokaX 的翻译原文和 github PR 及 actions 的基础了解
|
45
|
-
|
46
|
-
翻译排版参考[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines/blob/master/README.zh-Hans.md) \
|
47
|
-
**截止本指南写就时,shokaX 存在大量不符合此指北的翻译,我们欢迎提交 PR 修正这些错误**
|
48
|
-
|
49
|
-
有关审查(Review)的说明:
|
50
|
-
1. 您在 PR 时应打开允许维护者修改 PR,以便我们进行修改
|
51
|
-
2. 您愿意接受长时间的等待(一般不超过15天)
|
52
|
-
3. 您能够接受因翻译质量等问题而提出的疑问,并愿意讨论是否接受更改
|
53
|
-
|
54
|
-
PR提交参考代码贡献指南即可
|
55
|
-
|
56
|
-
# 最后需要注意的事项
|
57
|
-
有问题可以前往讨论区进行讨论,其他渠道正在建设 \
|
58
|
-
**本项目的每个贡献者都是理应感谢的人。**
|