hexo-theme-shokax 0.4.18 → 0.4.20
Sign up to get free protection for your applications and to get access to all the features.
- package/_config.yml +8 -0
- package/languages/en.yml +2 -0
- package/languages/ja.yml +2 -0
- package/languages/zh-CN.yml +2 -0
- package/languages/zh-HK.yml +2 -0
- package/languages/zh-TW.yml +2 -0
- package/layout/_partials/layout.pug +8 -2
- package/layout/_partials/post/footer.pug +8 -5
- package/package.json +17 -17
- package/scripts/generaters/script.js +0 -4
- package/source/js/_app/page/fancybox.ts +50 -59
- package/source/js/_app/pjax/refresh.ts +1 -3
- package/source/js/_app/pjax/siteInit.ts +1 -1
package/_config.yml
CHANGED
@@ -375,6 +375,14 @@ vendors:
|
|
375
375
|
source: cdnjs
|
376
376
|
url: jquery/3.5.1/jquery.min.js
|
377
377
|
sri: "sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2"
|
378
|
+
fancybox:
|
379
|
+
source: cdnjs
|
380
|
+
url: fancybox/3.5.7/jquery.fancybox.min.js
|
381
|
+
sri: "sha384-Zm+UU4tdcfAm29vg+MTbfu//q5B/lInMbMCr4T8c9rQFyOv6PlfQYpB5wItcXWe7"
|
382
|
+
justifiedGallery:
|
383
|
+
source: cdnjs
|
384
|
+
url: justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
|
385
|
+
sri: "sha384-TOxsBplaL96/QDWPIUg+ye3v89qSE3s22XNtJMmCeZEep3cVDmXy1zEfZvVv+y2m"
|
378
386
|
async_js:
|
379
387
|
fancybox:
|
380
388
|
source: cdnjs
|
package/languages/en.yml
CHANGED
@@ -67,6 +67,7 @@ footer:
|
|
67
67
|
powered: "Powered by %s"
|
68
68
|
total_views: Total Views
|
69
69
|
total_visitors: Total Visitors
|
70
|
+
loading: "Loading..."
|
70
71
|
|
71
72
|
counter:
|
72
73
|
index:
|
@@ -109,6 +110,7 @@ symbol:
|
|
109
110
|
comma: ", "
|
110
111
|
period: ". "
|
111
112
|
colon: ": "
|
113
|
+
space: " "
|
112
114
|
year: "Y"
|
113
115
|
month: "M"
|
114
116
|
|
package/languages/ja.yml
CHANGED
@@ -67,6 +67,7 @@ footer:
|
|
67
67
|
powered: "Powered by %s"
|
68
68
|
total_views: 閲覧合計数
|
69
69
|
total_visitors: 合計閲覧者数
|
70
|
+
loading: "ローディング..."
|
70
71
|
|
71
72
|
counter:
|
72
73
|
index:
|
@@ -109,6 +110,7 @@ symbol:
|
|
109
110
|
comma: "、"
|
110
111
|
period: "。"
|
111
112
|
colon: ":"
|
113
|
+
space: " "
|
112
114
|
year: 年
|
113
115
|
month: 月
|
114
116
|
|
package/languages/zh-CN.yml
CHANGED
@@ -67,6 +67,7 @@ footer:
|
|
67
67
|
powered: "基于 %s"
|
68
68
|
total_views: 总访问量
|
69
69
|
total_visitors: 总访客量
|
70
|
+
loading: "加载中..."
|
70
71
|
|
71
72
|
counter:
|
72
73
|
index:
|
@@ -109,6 +110,7 @@ symbol:
|
|
109
110
|
comma: ","
|
110
111
|
period: "。"
|
111
112
|
colon: ":"
|
113
|
+
space: " "
|
112
114
|
year: 年
|
113
115
|
month: 月
|
114
116
|
|
package/languages/zh-HK.yml
CHANGED
@@ -67,6 +67,7 @@ footer:
|
|
67
67
|
powered: "基於 %s"
|
68
68
|
total_views: 總瀏覽次數
|
69
69
|
total_visitors: 訪客總數
|
70
|
+
loading: "載入中..."
|
70
71
|
|
71
72
|
counter:
|
72
73
|
index:
|
@@ -109,6 +110,7 @@ symbol:
|
|
109
110
|
comma: ","
|
110
111
|
period: "。"
|
111
112
|
colon: ":"
|
113
|
+
space: " "
|
112
114
|
year: 年
|
113
115
|
month: 月
|
114
116
|
|
package/languages/zh-TW.yml
CHANGED
@@ -67,6 +67,7 @@ footer:
|
|
67
67
|
powered: "基於 %s"
|
68
68
|
total_views: 總瀏覽次數
|
69
69
|
total_visitors: 訪客總數
|
70
|
+
loading: "載入中..."
|
70
71
|
|
71
72
|
counter:
|
72
73
|
index:
|
@@ -109,6 +110,7 @@ symbol:
|
|
109
110
|
comma: ","
|
110
111
|
period: "。"
|
111
112
|
colon: ":"
|
113
|
+
space: " "
|
112
114
|
year: 年
|
113
115
|
month: 月
|
114
116
|
|
@@ -94,11 +94,13 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
94
94
|
else
|
95
95
|
- audioValue = "undefined"
|
96
96
|
|
97
|
+
- var ccIcon = '<i class="ic i-creative-commons"></i>'
|
98
|
+
- var ccText = theme.creative_commons.license.toUpperCase()
|
97
99
|
script(data-config type="text/javascript").
|
98
100
|
var LOCAL = {
|
99
101
|
ispost: !{is_post()},
|
100
|
-
|
101
|
-
|
102
|
+
path: `#{_permapath(page.path)}`,
|
103
|
+
favicon: {
|
102
104
|
show: `#{__('favicon.show')}`,
|
103
105
|
hide: `#{__('favicon.hide')}`
|
104
106
|
},
|
@@ -107,6 +109,8 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
107
109
|
empty: "!{__('search.empty')}",
|
108
110
|
stats: "!{__('search.stats')}"
|
109
111
|
},
|
112
|
+
nocopy: "!{!!page.nocopy}",
|
113
|
+
copyright: `!{page.copyright !== false ? (page.nocopy === true ? __("tips.nocopy") : __("tips.copyright", ccIcon + ccText)) : undefined}`,
|
110
114
|
copy_tex: #{!!page.math},
|
111
115
|
katex: #{!!page.math},
|
112
116
|
mermaid: #{!!page.mermaid},
|
@@ -136,6 +140,8 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
136
140
|
|
137
141
|
!= vendor_js('pace')
|
138
142
|
!= vendor_js('jquery')
|
143
|
+
!= vendor_js('fancybox')
|
144
|
+
!= vendor_js('justifiedGallery')
|
139
145
|
|
140
146
|
if theme.polyfill.enable
|
141
147
|
script(src=`https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=4.8.0&features=${theme.polyfill.features}` defer)
|
@@ -1,16 +1,19 @@
|
|
1
1
|
div(class="meta")
|
2
|
-
if
|
3
|
-
|
2
|
+
if theme.twikoo.enable || theme.waline.pageview
|
3
|
+
span(class="item")
|
4
4
|
span(class="icon")
|
5
5
|
i(class="ic i-eye")
|
6
|
-
span
|
6
|
+
span(class="text")
|
7
|
+
!=__('footer.total_views') + __('symbol.colon')
|
7
8
|
- var prefixedPath = post.path.startsWith('/') ? post.path : '/' + post.path
|
8
|
-
span(id="twikoo_visitors" class="waline-pageview-count" data-path=prefixedPath)
|
9
|
+
span(id="twikoo_visitors" class="waline-pageview-count" data-path=prefixedPath)
|
10
|
+
!=__('footer.loading')
|
11
|
+
if date(post.date) !== date(post.updated) || time(post.date) !== time(post.updated)
|
9
12
|
span(class="item")
|
10
13
|
span(class="icon")
|
11
14
|
i(class="ic i-calendar-check")
|
12
15
|
span(class="text")
|
13
|
-
!= __('post.edited')
|
16
|
+
!= __('post.edited') + __('symbol.space')
|
14
17
|
time(title=__('post.modified') + __('symbol.colon') + full_date(post.updated) itemprop="dateModified" datetime=moment(post.updated).format())
|
15
18
|
!= date(post.updated)
|
16
19
|
|
package/package.json
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.20",
|
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.
|
9
|
+
"packageManager": "pnpm@9.15.4",
|
10
10
|
"scripts": {
|
11
11
|
"test": "tsc --build --verbose",
|
12
12
|
"build": "node ./toolbox/compiler.mjs"
|
13
13
|
},
|
14
14
|
"devDependencies": {
|
15
15
|
"@types/fancybox": "^3.5.7",
|
16
|
-
"@types/jquery": "^3.5.
|
16
|
+
"@types/jquery": "^3.5.32",
|
17
17
|
"@types/js-yaml": "^4.0.9",
|
18
18
|
"@types/katex": "^0.16.7",
|
19
|
-
"@types/node": "^22.
|
19
|
+
"@types/node": "^22.10.10",
|
20
20
|
"@types/quicklink": "^2.3.4",
|
21
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
22
|
-
"@typescript-eslint/parser": "^8.
|
23
|
-
"eslint": "^9.
|
21
|
+
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
22
|
+
"@typescript-eslint/parser": "^8.21.0",
|
23
|
+
"eslint": "^9.19.0",
|
24
24
|
"eslint-config-standard": "~17",
|
25
|
-
"eslint-plugin-vue": "^9.
|
26
|
-
"glob": "^11.0.
|
27
|
-
"typescript": "^5.
|
25
|
+
"eslint-plugin-vue": "^9.32.0",
|
26
|
+
"glob": "^11.0.1",
|
27
|
+
"typescript": "^5.7.3"
|
28
28
|
},
|
29
29
|
"dependencies": {
|
30
|
-
"@algolia/client-search": "^5.
|
31
|
-
"@waline/client": "^3.
|
32
|
-
"algoliasearch": "5.
|
33
|
-
"esbuild": "^0.24.
|
30
|
+
"@algolia/client-search": "^5.20.0",
|
31
|
+
"@waline/client": "^3.5.1",
|
32
|
+
"algoliasearch": "5.20.0",
|
33
|
+
"esbuild": "^0.24.2",
|
34
34
|
"hexo": "^7.3.0",
|
35
35
|
"hexo-algoliasearch": "^2.0.1",
|
36
36
|
"hexo-feed": "^1.1.2",
|
@@ -38,14 +38,14 @@
|
|
38
38
|
"hexo-pagination": "^4.0.0",
|
39
39
|
"hexo-renderer-pug": "^3.0.0",
|
40
40
|
"hexo-util": "^3.3.0",
|
41
|
-
"instantsearch.js": "^4.
|
41
|
+
"instantsearch.js": "^4.77.1",
|
42
42
|
"js-yaml": "^4.1.0",
|
43
|
-
"katex": "^0.16.
|
43
|
+
"katex": "^0.16.21",
|
44
44
|
"mouse-firework": "^0.0.6",
|
45
45
|
"quicklink": "^2.3.0",
|
46
46
|
"theme-shokax-anime": "^0.0.7",
|
47
47
|
"theme-shokax-pjax": "^0.0.3",
|
48
|
-
"twikoo": "^1.6.
|
48
|
+
"twikoo": "^1.6.41",
|
49
49
|
"unlazy": "^0.12.1"
|
50
50
|
},
|
51
51
|
"engines": {
|
@@ -39,10 +39,6 @@ hexo.extend.generator.register("script", function(locals) {
|
|
39
39
|
darkmode: theme.darkmode,
|
40
40
|
auto_dark: theme.auto_dark,
|
41
41
|
auto_scroll: theme.auto_scroll,
|
42
|
-
js: {
|
43
|
-
copy_tex: (0, import_utils.getVendorLink)(hexo, theme.vendors.async_js.copy_tex),
|
44
|
-
fancybox: (0, import_utils.getVendorLink)(hexo, theme.vendors.async_js.fancybox)
|
45
|
-
},
|
46
42
|
css: {
|
47
43
|
katex: (0, import_utils.getVendorLink)(hexo, theme.vendors.css.katex),
|
48
44
|
mermaid: {
|
@@ -7,70 +7,61 @@ export const postFancybox = (p:string) => {
|
|
7
7
|
if (document.querySelector(p + ' .md img')) {
|
8
8
|
vendorCss('fancybox')
|
9
9
|
vendorCss('justifiedGallery')
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
$dom.each(p + ' p.gallery', (element) => {
|
11
|
+
const box = document.createElement('div')
|
12
|
+
box.className = 'gallery'
|
13
|
+
box.setAttribute('data-height', String(element.getAttribute('data-height') || 220))
|
14
14
|
|
15
|
-
|
16
|
-
const box = document.createElement('div')
|
17
|
-
box.className = 'gallery'
|
18
|
-
box.setAttribute('data-height', String(element.getAttribute('data-height') || 220))
|
15
|
+
box.innerHTML = element.innerHTML.replace(/<br>/g, '')
|
19
16
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
element.remove()
|
24
|
-
})
|
25
|
-
|
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
|
-
})
|
17
|
+
element.parentNode.insertBefore(box, element)
|
18
|
+
element.remove()
|
19
|
+
})
|
48
20
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
21
|
+
$dom.each(p + ' .md img:not(.emoji):not(.vemoji)', (element) => {
|
22
|
+
const $image = $(element)
|
23
|
+
const imageLink = $image.attr('data-src') || $image.attr('src') // 替换
|
24
|
+
const $imageWrapLink = $image.wrap('<a class="fancybox" href="' + imageLink + '" itemscope itemtype="https://schema.org/ImageObject" itemprop="url"></a>').parent('a')
|
25
|
+
let info; let captionClass = 'image-info'
|
26
|
+
if (!$image.is('a img')) {
|
27
|
+
$image.data('safe-src', imageLink)
|
28
|
+
if (!$image.is('.gallery img')) {
|
29
|
+
$imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default')
|
30
|
+
} else {
|
31
|
+
captionClass = 'jg-caption'
|
32
|
+
}
|
33
|
+
}
|
34
|
+
if ((info = element.getAttribute('title'))) {
|
35
|
+
$imageWrapLink.attr('data-caption', info)
|
36
|
+
const para = document.createElement('span')
|
37
|
+
const txt = document.createTextNode(info)
|
38
|
+
para.appendChild(txt)
|
39
|
+
para.addClass(captionClass)
|
40
|
+
insertAfter(element, para)
|
41
|
+
}
|
42
|
+
})
|
60
43
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
})
|
71
|
-
// @ts-ignore
|
72
|
-
}, window.jQuery)
|
44
|
+
$dom.each(p + ' div.gallery', (el, i) => {
|
45
|
+
// @ts-ignore
|
46
|
+
$(el).justifiedGallery({
|
47
|
+
rowHeight: $(el).data('height') || 120,
|
48
|
+
rel: 'gallery-' + i
|
49
|
+
}).on('jg.complete', function () {
|
50
|
+
$(this).find('a').each((k, ele) => {
|
51
|
+
ele.setAttribute('data-fancybox', 'gallery-' + i)
|
52
|
+
})
|
73
53
|
})
|
74
54
|
})
|
55
|
+
|
56
|
+
$.fancybox.defaults.hash = false
|
57
|
+
$(p + ' .fancybox').fancybox({
|
58
|
+
loop: true,
|
59
|
+
// @ts-ignore
|
60
|
+
helpers: {
|
61
|
+
overlay: {
|
62
|
+
locked: false
|
63
|
+
}
|
64
|
+
}
|
65
|
+
})
|
75
66
|
}
|
76
67
|
}
|
@@ -35,7 +35,7 @@ export const pjaxReload = () => {
|
|
35
35
|
|
36
36
|
export const siteRefresh = async (reload) => {
|
37
37
|
if (__shokax_antiFakeWebsite__) {
|
38
|
-
if (window.location.origin !== CONFIG.hostname) {
|
38
|
+
if (window.location.origin !== CONFIG.hostname && window.location.origin !== "http://localhost:4000") {
|
39
39
|
window.location.href = CONFIG.hostname
|
40
40
|
/*! 我知道你正在试图去除这段代码,虽然我无法阻止你,但我劝你好自为之 */
|
41
41
|
alert('检测到非法仿冒网站,已自动跳转回正确首页;\nWe have detected a fake website, and you have been redirected to the correct homepage.')
|
@@ -46,8 +46,6 @@ export const siteRefresh = async (reload) => {
|
|
46
46
|
setLocalUrl(window.location.href)
|
47
47
|
|
48
48
|
vendorCss('katex');
|
49
|
-
// await import('katex/dist/katex.min.css')
|
50
|
-
// vendorJs('copy_tex')
|
51
49
|
await import('katex/dist/contrib/copy-tex.mjs')
|
52
50
|
vendorCss('mermaid')
|
53
51
|
|
@@ -100,7 +100,7 @@ const siteInit = async () => {
|
|
100
100
|
cloudflareInit()
|
101
101
|
|
102
102
|
if (__shokax_antiFakeWebsite__) {
|
103
|
-
if (window.location.origin !== CONFIG.hostname) {
|
103
|
+
if (window.location.origin !== CONFIG.hostname && window.location.origin !== "http://localhost:4000") {
|
104
104
|
window.location.href = CONFIG.hostname
|
105
105
|
/*! 我知道你正在试图去除这段代码,虽然我无法阻止你,但我劝你好自为之 */
|
106
106
|
alert('检测到非法仿冒网站,已自动跳转回正确首页;\nWe have detected a fake website, and you have been redirected to the correct homepage.')
|