hexo-theme-shokax 0.0.1-alpha2 → 0.0.1-alpha3
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/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_shield)
|
3
3
|

|
4
4
|

|
5
|
-
|
5
|
+

|
6
6
|
|
7
7
|
此项目是shoka的一个魔改版,致力于提高性能和优化魔改体验 \
|
8
8
|
本项目处于高强度开发期,但github仓库版本已基本可用 \s
|
package/_config.yml
CHANGED
@@ -24,14 +24,13 @@ pwa:
|
|
24
24
|
experiments:
|
25
25
|
noPlayer: false # 禁用音乐播放器
|
26
26
|
gradient: false # 使用CSS渐变作为文章封面
|
27
|
-
gradientCover: "" # 当gradient为true时使用的主页面cover
|
27
|
+
gradientCover: "" # 当gradient为true时使用的主页面cover(为空则使用bing随机图片)
|
28
28
|
debug: false # 使用debug模式启动
|
29
29
|
|
30
30
|
icon:
|
31
31
|
favicon: "/favicon.ico"
|
32
32
|
apple_touch_icon: "/apple-touch-icon.png"
|
33
33
|
|
34
|
-
baidu_analytics: ""
|
35
34
|
seo:
|
36
35
|
bing: "bing-key"
|
37
36
|
google: "google-key"
|
@@ -40,6 +39,7 @@ seo:
|
|
40
39
|
|
41
40
|
visitor:
|
42
41
|
clarity: false
|
42
|
+
baiduAnalytics: false
|
43
43
|
|
44
44
|
darkmode: false
|
45
45
|
auto_dark: # 自动亮/暗模式
|
@@ -1,17 +1,18 @@
|
|
1
1
|
//- https://blog.cyfan.top/p/c0af86bb.html#%E5%AE%89%E8%A3%85-Install
|
2
|
+
- var timeNow = new Date().getTime()
|
2
3
|
if theme.pwa.enable
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
- var sworker = theme.pwa.serviceworker
|
5
|
+
script(data-pjax async).
|
6
|
+
if ('serviceWorker' in navigator) {
|
7
|
+
navigator.serviceWorker.register("/#{sworker}?time=#{timeNow}").then(async (reg) => {
|
8
|
+
if (window.localStorage.getItem('install') !== 'true') {
|
9
|
+
window.localStorage.setItem('install', 'true');
|
10
|
+
setTimeout(() => {
|
11
|
+
window.location.reload()
|
12
|
+
}, 500)
|
13
|
+
}
|
14
|
+
}).catch(err => {
|
15
|
+
console.log(err)
|
16
|
+
});
|
17
|
+
}
|
17
18
|
link(rel="manifest" href=`/${theme.pwa.manifest}`)
|
@@ -31,8 +31,9 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
31
31
|
!= partial('_partials/header.pug', {}, {cache: true})
|
32
32
|
div(id="imgs" class="pjax")
|
33
33
|
if theme.experiments.gradient
|
34
|
-
|
35
|
-
|
34
|
+
//- cover不可用时用Bing随机图片代替
|
35
|
+
- var coverImage = theme?.experiments?.gradientCover || "https://7ed.net/bing/api"
|
36
|
+
img(src=coverImage)
|
36
37
|
else
|
37
38
|
- var covers = _cover(page, 6)
|
38
39
|
if covers.length === 6
|
@@ -101,7 +102,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
101
102
|
if page.outime === false
|
102
103
|
| outime: false,
|
103
104
|
else
|
104
|
-
| outime: true,template:
|
105
|
+
| outime: true,template: `!{ __('outime.template') }`,
|
105
106
|
if page.quiz
|
106
107
|
| quiz: {
|
107
108
|
!= `choice: \'${__('quiz.choice')}\',`
|
@@ -1,10 +1,10 @@
|
|
1
|
-
- var hmSrc = `https://hm.baidu.com/hm.js?${ theme.
|
2
|
-
if theme.
|
1
|
+
- var hmSrc = `https://hm.baidu.com/hm.js?${ theme.visitor.baiduAnalytics }`
|
2
|
+
if theme.visitor.baiduAnalytics
|
3
3
|
script(data-pjax=true).
|
4
4
|
var _hmt = _hmt || [];
|
5
5
|
(function () {
|
6
6
|
const hm = document.createElement("script");
|
7
|
-
hm.src = #{hmSrc}
|
7
|
+
hm.src = "#{hmSrc}"
|
8
8
|
hm.async = true;
|
9
9
|
const s = document.getElementsByTagName("script")[0];
|
10
10
|
s.parentNode.insertBefore(hm, s);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.0.1-
|
3
|
+
"version": "0.0.1-alpha3",
|
4
4
|
"description": "a hexo theme based on shoka",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "https://github.com/zkz098/hexo-theme-shokaX",
|
@@ -16,10 +16,10 @@
|
|
16
16
|
"@types/jquery": "^3.5.14",
|
17
17
|
"@types/js-yaml": "^4.0.5",
|
18
18
|
"@types/lozad": "^1.16.1",
|
19
|
-
"@types/node": "^18.11.
|
19
|
+
"@types/node": "^18.11.18",
|
20
20
|
"@types/shelljs": "^0.8.11",
|
21
|
-
"@typescript-eslint/eslint-plugin": "^5.47.
|
22
|
-
"@typescript-eslint/parser": "^5.47.
|
21
|
+
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
22
|
+
"@typescript-eslint/parser": "^5.47.1",
|
23
23
|
"eslint": "^8.30.0",
|
24
24
|
"eslint-config-standard": "^17.0.0",
|
25
25
|
"eslint-plugin-import": "^2.26.0",
|