hexo-theme-shokax 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +0 -1
- package/README_en.MD +67 -36
- package/UsageRestrictions.md +3 -1
- package/layout/_mixin/breadcrumb.pug +2 -2
- package/layout/_partials/layout.pug +11 -2
- package/package.json +2 -2
- package/source/js/_app/library/vue.js +45 -41
- package/source/js/_app/pjax/siteInit.js +2 -0
package/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
* [ShokaX 正在寻找社区维护者](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/137)
|
3
3
|
|
4
4
|
# hexo-theme-shokaX
|
5
|
-
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_shield)
|
6
5
|
![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX)
|
7
6
|
![stars](https://img.shields.io/github/stars/theme-shoka-x/hexo-theme-shokaX)
|
8
7
|
![version](https://shields.io/npm/v/hexo-theme-shokax)
|
package/README_en.MD
CHANGED
@@ -1,56 +1,87 @@
|
|
1
|
-
|
1
|
+
# 📣 Announcement
|
2
|
+
* [ShokaX is looking for community maintainers](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/137)
|
2
3
|
|
3
4
|
# hexo-theme-shokaX
|
4
|
-
|
5
|
-
![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX)
|
5
|
+
![LICENSE](https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX)
|
6
6
|
![stars](https://img.shields.io/github/stars/theme-shoka-x/hexo-theme-shokaX)
|
7
7
|
![version](https://shields.io/npm/v/hexo-theme-shokax)
|
8
8
|
![build](https://img.shields.io/github/actions/workflow/status/theme-shoka-x/hexo-theme-shokaX/build-theme.yml)
|
9
9
|
|
10
10
|
Language: [简体中文](./README.md) | English \
|
11
|
-
This project is a
|
12
|
-
The reason for its
|
11
|
+
This project is a fork (spiritual successor) of Shoka, aimed at improving performance and optimizing the modified experience. \
|
12
|
+
The reason for its creation is that Shoka has not been updated for two years, accumulating a large number of bugs and feature requests.
|
13
13
|
|
14
|
-
The community resource
|
14
|
+
The community resource guide and plugin repository for shokaX are available at [awesome-shokaX](https://github.com/theme-shoka-x/awesome-shokaX)
|
15
15
|
|
16
|
-
## 💬 Differences
|
17
|
-
The original
|
16
|
+
## 💬 Differences from Shoka
|
17
|
+
The original Shoka used a combination of JavaScript + Native + Nunjucks technologies. \
|
18
|
+
ShokaX, on the other hand, uses TypeScript + Vue 3 + Pug technologies and has changed many hard-to-access CDN links.
|
18
19
|
|
19
20
|
## ✨ Feature List
|
20
|
-
| Feature Name | Implementation Status | Feature Name | Implementation Status |
|
21
|
-
|:-------------------------------:|:---------------------:|:------------------------------:|:---------------------:|
|
22
|
-
| PWA Support | ✅ | JSD Splitting | ✅ |
|
23
|
-
| Injection API | ✅ | Community Plugin System | ✅ |
|
24
|
-
| Custom Fonts | ✅* | Custom Styles | ✅* |
|
25
|
-
| Multiple Comment System Support | ✅ | User Behavior Analysis Support | ✅ |
|
26
|
-
| Record Number at the Bottom | ✅ | Custom Footer | ✅* |
|
27
|
-
| CSS Gradient Cover | ✅ | Typescript Support | ✅ |
|
28
|
-
|
29
|
-
Remarks:
|
30
|
-
- *: Requires implementation using Injection API.
|
31
|
-
|
32
|
-
## 🔧 How to Install?
|
33
|
-
It is recommended to use [ShokaX-CLI](https://github.com/theme-shoka-x/shokaX-CLI) and execute the following command:
|
34
|
-
```bash
|
35
|
-
npm i shokax-cli --location=global
|
36
|
-
# hexo init initializes the environment
|
37
|
-
SXC install shokaX
|
38
|
-
```
|
39
|
-
[Click here](https://docs.kaitaku.xyz/guide/#%E9%85%8D%E7%BD%AE%E4%B8%BB%E9%A2%98) for the next configuration steps.
|
40
21
|
|
41
|
-
|
22
|
+
| Feature | Status | Feature | Status |
|
23
|
+
|:-------------------------------:|:------:|:------------------------------:|:------:|
|
24
|
+
| PWA Support | ✅ | JSD Split | ✅ |
|
25
|
+
| Injection API | ✅ | Community Plugin System | ✅ |
|
26
|
+
| Custom Fonts | ✅* | Custom Styles | ✅* |
|
27
|
+
| Multiple Comment System Support | ✅ | AI-generated Article Summaries | 🔬 |
|
28
|
+
| Bottom Record Number | ✅ | Custom Footer | ✅* |
|
29
|
+
| CSS Gradient Cover | ✅ | TypeScript Support | ✅ |
|
30
|
+
|
31
|
+
Notes:
|
32
|
+
- *: Requires implementation using Injection API
|
33
|
+
- 🔬: In experimentation, may have issues
|
42
34
|
|
35
|
+
## 🔧 How to Install
|
36
|
+
Note: This project requires node.js 18.x or higher to run. \
|
37
|
+
It is recommended to use [ShokaX-CLI](https://github.com/zkz098/shokaX-CLI) \
|
38
|
+
[Click here](https://docs.kaitaku.xyz/guide/#%E9%85%8D%E7%BD%AE%E4%B8%BB%E9%A2%98) for the next configuration steps.
|
39
|
+
|
40
|
+
For the GitHub repository, it is recommended to download from the releases on the right side, with the following steps:
|
43
41
|
- Click on the Latest version in Releases
|
44
|
-
- Download
|
45
|
-
- Unzip to use as
|
42
|
+
- Download `Source code(zip)` from Assets
|
43
|
+
- Unzip to use as a theme
|
44
|
+
|
45
|
+
## 📚 Sub-projects
|
46
|
+
- [ShokaX docs](https://github.com/theme-shoka-x/shokaX-docs) ShokaX Theme Documentation (work in progress, contributions welcome!)
|
47
|
+
- [HRMNMI](https://github.com/theme-shoka-x/hexo-renderer-multi-next-markdown-it) The markdown renderer used by ShokaX (awaiting refactoring)
|
48
|
+
- [ShokaX CLI](https://github.com/theme-shoka-x/shokaX-CLI) ShokaX Command Line Installer
|
49
|
+
- [ShokaX Pjax](https://github.com/theme-shoka-x/theme-shokax-pjax) Efficient Pjax implementation by ShokaX
|
50
|
+
- [ShokaX Anime](https://github.com/theme-shoka-x/theme-shokax-anime) Minimalistic Anime.js implementation by ShokaX
|
51
|
+
|
52
|
+
## 🛠️ Development
|
53
|
+
[ShokaX Official Development Documentation](https://docs.kaitaku.xyz/develop/basic/)
|
54
|
+
|
55
|
+
Recommended reading for contributing:
|
56
|
+
- [Hexo Official Documentation](https://hexo.io/zh-cn/docs/templates)
|
57
|
+
- [Stylus Chinese Documentation](http://stylus.bootcss.com/)
|
58
|
+
- [Pug Template Engine Chinese Documentation](https://www.pugjs.cn/api/getting-started.html)
|
59
|
+
- [TypeScript Chinese Documentation](https://www.tslang.cn/docs/home.html)
|
60
|
+
- [Easy Hexo](https://easyhexo.com/)
|
46
61
|
|
47
62
|
# License
|
48
|
-
|
49
|
-
|
63
|
+
License: AGPL 3 or later
|
64
|
+
|
65
|
+
## Special Note
|
66
|
+
The primary purpose of the AGPL license is to restrict distribution after modification, preventing unauthorized secondary modification for commercial purposes. \
|
67
|
+
Modifications to the source code **must** be open-sourced, as per the AGPL license. Building a website requires open-sourcing modified parts.
|
50
68
|
|
51
|
-
##
|
69
|
+
## Usage Special Note
|
70
|
+
In accordance with AGPLv3 Section 7, we have added some additional terms. \
|
71
|
+
Please see [Usage Restrictions](./UsageRestrictions.md). Using ShokaX implies that you are aware of the contents of this file.
|
52
72
|
|
73
|
+
# Acknowledgments
|
74
|
+
## Open Source Projects
|
75
|
+
| Name | Author | Description |
|
76
|
+
|:----------------:|:-----------------:|:--------------------------------------------:|
|
77
|
+
| Hexo | Hexo contributors | Provided a solid foundation for this project |
|
78
|
+
| hexo-theme-shoka | amehime | Parent theme of this project |
|
79
|
+
|
80
|
+
## Developers
|
53
81
|
[![](https://contributors-img.web.app/image?repo=theme-shoka-x/hexo-theme-shokaX)](https://github.com/theme-shoka-x/hexo-theme-shokaX/graphs/contributors)
|
54
82
|
|
55
|
-
## Special
|
56
|
-
[<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport)
|
83
|
+
## Special Thanks
|
84
|
+
[<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport)
|
85
|
+
|
86
|
+
## Other Information
|
87
|
+
![Star history chart](https://api.star-history.com/svg?repos=theme-shoka-x/hexo-theme-shokaX&type=Date)
|
package/UsageRestrictions.md
CHANGED
@@ -18,4 +18,6 @@
|
|
18
18
|
- 发出警告通知并要求立即纠正违规行为;(根据`AGPLv3 八`)
|
19
19
|
- 暂停或终止您对 ShokaX 及其子项目的使用权限并取消GPLv3授予您的权利;(根据`AGPLv3 八`)
|
20
20
|
- 取消您获取 ShokaX 社区支持和进行协作的权利;(社区管理)
|
21
|
-
- 追究法律责任,包括要求赔偿因违规行为给 ShokaX 项目组造成的损失。(依照相关法律而定)
|
21
|
+
- 追究法律责任,包括要求赔偿因违规行为给 ShokaX 项目组造成的损失。(依照相关法律而定)
|
22
|
+
|
23
|
+
当发生纠纷时,全部由甲方(即zkz098)所在地负责,适用中华人民共和国法律。
|
@@ -13,7 +13,7 @@ mixin BCRender(post, home)
|
|
13
13
|
i(class="ic i-angle-right")
|
14
14
|
each cat,index in post.categories.toArray()
|
15
15
|
if home
|
16
|
-
if index===cat_length
|
16
|
+
if index===cat_length-1
|
17
17
|
span(class="current" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem")
|
18
18
|
a(href=url_for(cat.path) itemprop="item" rel="index" title=__('post.in')+ cat.name)
|
19
19
|
span(itemprop="name")
|
@@ -28,6 +28,6 @@ mixin BCRender(post, home)
|
|
28
28
|
else
|
29
29
|
a(href=url_for(cat.path) title=__('post.in')+cat.name)
|
30
30
|
!= cat.name
|
31
|
-
if cat_length > 1 && index !== cat_length
|
31
|
+
if cat_length > 1 && index !== cat_length - 1
|
32
32
|
i(class="ic i-angle-right")
|
33
33
|
!= '</div>'
|
@@ -71,6 +71,15 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
71
71
|
!= partial('_partials/footer.pug', {}, {cache: true})
|
72
72
|
- var ccIcon = '<i class="ic i-creative-commons"></i>'
|
73
73
|
- var ccText = theme.creative_commons.license.toUpperCase()
|
74
|
+
- var audioValue
|
75
|
+
if page.audio
|
76
|
+
- audioValue = JSON.stringify(page.audio);
|
77
|
+
|
78
|
+
else if page.audio === false
|
79
|
+
- audioValue = JSON.stringify({});
|
80
|
+
else
|
81
|
+
- audioValue = "undefined"
|
82
|
+
|
74
83
|
script(data-config type="text/javascript").
|
75
84
|
var LOCAL = {
|
76
85
|
path: `#{_permapath(page.path)}`,
|
@@ -88,11 +97,11 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
88
97
|
copy_tex: #{!!page.math},
|
89
98
|
katex: #{!!page.math},
|
90
99
|
mermaid: #{!!page.mermaid},
|
91
|
-
audio:
|
100
|
+
audio: !{audioValue},
|
92
101
|
fancybox: #{page.fancybox !== false},
|
93
102
|
nocopy: #{!!page.nocopy},
|
94
103
|
outime: #{page.outime !== false},
|
95
|
-
template:
|
104
|
+
template: `!{__('outime.template')}`,
|
96
105
|
quiz: {
|
97
106
|
choice: `#{__('quiz.choice')}`,
|
98
107
|
multiple: `#{__('quiz.multiple')}`,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.5",
|
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",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"jsdom": "^22.1.0"
|
39
39
|
},
|
40
40
|
"dependencies": {
|
41
|
-
"esbuild": "^0.
|
41
|
+
"esbuild": "^0.19.2",
|
42
42
|
"js-yaml": "^4.1.0",
|
43
43
|
"lozad": "^1.16.0",
|
44
44
|
"theme-shokax-anime": "^0.0.4",
|
@@ -1,52 +1,56 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.initVue = void 0;
|
3
4
|
const storage_1 = require("./storage");
|
4
5
|
const anime_1 = require("./anime");
|
5
6
|
const dom_1 = require("./dom");
|
6
7
|
const globalVars_1 = require("../globals/globalVars");
|
7
8
|
const themeColor_1 = require("../globals/themeColor");
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
const hideNeko = () => {
|
21
|
-
(0, anime_1.transition)(neko, {
|
22
|
-
delay: 2500,
|
23
|
-
opacity: 0
|
24
|
-
}, () => {
|
25
|
-
globalVars_1.BODY.removeChild(neko);
|
9
|
+
function initVue() {
|
10
|
+
Vue.createApp({
|
11
|
+
data() {
|
12
|
+
return {};
|
13
|
+
},
|
14
|
+
methods: {
|
15
|
+
changeThemeByBtn() {
|
16
|
+
let c;
|
17
|
+
const btn = (0, dom_1.$dom)('.theme').child('.ic');
|
18
|
+
const neko = globalVars_1.BODY.createChild('div', {
|
19
|
+
id: 'neko',
|
20
|
+
innerHTML: '<div class="planet"><div class="sun"></div><div class="moon"></div></div><div class="body"><div class="face"><section class="eyes left"><span class="pupil"></span></section><section class="eyes right"><span class="pupil"></span></section><span class="nose"></span></div></div>'
|
26
21
|
});
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
};
|
35
|
-
}
|
36
|
-
else {
|
37
|
-
neko.addClass('dark');
|
38
|
-
c = () => {
|
39
|
-
neko.removeClass('dark');
|
40
|
-
(0, themeColor_1.changeTheme)();
|
41
|
-
storage_1.$storage.set('theme', 'light');
|
42
|
-
hideNeko();
|
22
|
+
const hideNeko = () => {
|
23
|
+
(0, anime_1.transition)(neko, {
|
24
|
+
delay: 2500,
|
25
|
+
opacity: 0
|
26
|
+
}, () => {
|
27
|
+
globalVars_1.BODY.removeChild(neko);
|
28
|
+
});
|
43
29
|
};
|
30
|
+
if (btn.hasClass('i-sun')) {
|
31
|
+
c = () => {
|
32
|
+
neko.addClass('dark');
|
33
|
+
(0, themeColor_1.changeTheme)('dark');
|
34
|
+
storage_1.$storage.set('theme', 'dark');
|
35
|
+
hideNeko();
|
36
|
+
};
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
neko.addClass('dark');
|
40
|
+
c = () => {
|
41
|
+
neko.removeClass('dark');
|
42
|
+
(0, themeColor_1.changeTheme)();
|
43
|
+
storage_1.$storage.set('theme', 'light');
|
44
|
+
hideNeko();
|
45
|
+
};
|
46
|
+
}
|
47
|
+
(0, anime_1.transition)(neko, 1, () => {
|
48
|
+
setTimeout(c, 210);
|
49
|
+
}, () => {
|
50
|
+
neko.display('block');
|
51
|
+
});
|
44
52
|
}
|
45
|
-
(0, anime_1.transition)(neko, 1, () => {
|
46
|
-
setTimeout(c, 210);
|
47
|
-
}, () => {
|
48
|
-
neko.display('block');
|
49
|
-
});
|
50
53
|
}
|
51
|
-
}
|
52
|
-
}
|
54
|
+
}).mount('#rightNav');
|
55
|
+
}
|
56
|
+
exports.initVue = initVue;
|
@@ -13,9 +13,11 @@ const handles_1 = require("../globals/handles");
|
|
13
13
|
const tools_1 = require("../globals/tools");
|
14
14
|
const fireworks_1 = require("../fireworks");
|
15
15
|
const theme_shokax_pjax_1 = __importDefault(require("theme-shokax-pjax"));
|
16
|
+
const vue_1 = require("../library/vue");
|
16
17
|
const siteInit = () => {
|
17
18
|
(0, scriptPjax_1.cloudflareInit)();
|
18
19
|
(0, domInit_1.default)();
|
20
|
+
(0, vue_1.initVue)();
|
19
21
|
(0, globalVars_1.setPjax)(new theme_shokax_pjax_1.default({
|
20
22
|
selectors: [
|
21
23
|
'head title',
|