hexo-theme-shokax 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
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
- If the repository address you are visiting is **zkz098/hexo-theme-shokaX**, please switch to the latest address: [theme-shoka-x/hexo-theme-shokaX](https://github.com/theme-shoka-x/hexo-theme-shokaX)
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
- [![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)
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 secondary development version of shoka (spiritual sequel), dedicated to improving performance and optimizing modding experience.
12
- The reason for its birth is that shoka has not been updated for two years, with a large backlog of bugs and feature requests.
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 navigation and plugin repository for shokaX is [awesome-shokaX](https://github.com/theme-shoka-x/awesome-shokaX)
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 with shoka
17
- The original shoka used javascript+Native+nunjucks technology, while shokaX uses typescript+Vue 3+Pug technology and has changed a lot of hard-to-access CDN links.
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
- It is recommended to download the GitHub repository from the Releases on the right-hand side, as follows:
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 the Source code(zip) in Assets
45
- - Unzip to use as the theme
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
- license: GPL 3 or later
49
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fzkz098%2Fhexo-theme-shokaX?ref=badge_large)
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
- ## Contributors
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 thanks
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)
@@ -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: `#{_safedump(page.audio)}`,
100
+ audio: !{audioValue},
92
101
  fancybox: #{page.fancybox !== false},
93
102
  nocopy: #{!!page.nocopy},
94
103
  outime: #{page.outime !== false},
95
- template: `#{__('outime.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.4",
3
+ "version": "0.3.6",
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",
@@ -14,26 +14,26 @@
14
14
  "@types/chai": "^4.3.5",
15
15
  "@types/fancybox": "^3.5.3",
16
16
  "@types/hexo": "^3.8.8",
17
- "@types/jquery": "^3.5.16",
17
+ "@types/jquery": "^3.5.17",
18
18
  "@types/js-yaml": "^4.0.5",
19
19
  "@types/lozad": "^1.16.1",
20
20
  "@types/mocha": "^10.0.1",
21
- "@types/node": "^20.4.4",
22
- "@typescript-eslint/eslint-plugin": "^6.2.0",
23
- "@typescript-eslint/parser": "^6.2.0",
24
- "chai": "^4.3.7",
25
- "eslint": "^8.45.0",
21
+ "@types/node": "^20.5.6",
22
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
23
+ "@typescript-eslint/parser": "^6.4.1",
24
+ "chai": "^4.3.8",
25
+ "eslint": "^8.47.0",
26
26
  "eslint-config-standard": "*",
27
27
  "eslint-plugin-chai-friendly": "^0.7.2",
28
- "eslint-plugin-import": "^2.27.5",
29
- "eslint-plugin-n": "^16.0.1",
28
+ "eslint-plugin-import": "^2.28.1",
29
+ "eslint-plugin-n": "^16.0.2",
30
30
  "eslint-plugin-promise": "^6.1.1",
31
- "eslint-plugin-vue": "^9.15.1",
31
+ "eslint-plugin-vue": "^9.17.0",
32
32
  "hexo-fs": "^4.1.1",
33
33
  "hexo-util": "^3.1.0",
34
- "instantsearch.js": "^4.56.7",
34
+ "instantsearch.js": "^4.56.9",
35
35
  "mocha": "^10.2.0",
36
- "typescript": "^5.1.6",
36
+ "typescript": "^5.2.2",
37
37
  "vue": "^3.3.4",
38
38
  "jsdom": "^22.1.0"
39
39
  },
@@ -46,7 +46,9 @@ hexo.extend.generator.register('script', function (locals) {
46
46
  disableVL: theme.disableVL,
47
47
  noPlayer: theme.experiments?.noPlayer,
48
48
  audio: undefined,
49
- fireworks: undefined
49
+ fireworks: (theme.fireworks && theme.fireworks.enable) ?
50
+ (theme.fireworks.color || ['rgba(255,182,185,.9)', 'rgba(250,227,217,.9)', 'rgba(187,222,214,.9)', 'rgba(138,198,209,.9)']) :
51
+ undefined
50
52
  };
51
53
  if (config?.algolia) {
52
54
  siteConfig.search = {
@@ -15,7 +15,6 @@ const fireworks_1 = require("../fireworks");
15
15
  const theme_shokax_pjax_1 = __importDefault(require("theme-shokax-pjax"));
16
16
  const vue_1 = require("../library/vue");
17
17
  const siteInit = () => {
18
- (0, scriptPjax_1.cloudflareInit)();
19
18
  (0, domInit_1.default)();
20
19
  (0, vue_1.initVue)();
21
20
  (0, globalVars_1.setPjax)(new theme_shokax_pjax_1.default({
@@ -47,6 +46,7 @@ const siteInit = () => {
47
46
  });
48
47
  (0, refresh_1.siteRefresh)(1);
49
48
  };
49
+ (0, scriptPjax_1.cloudflareInit)();
50
50
  window.addEventListener('DOMContentLoaded', siteInit, {
51
51
  passive: true
52
52
  });
@@ -369,11 +369,11 @@ const mediaPlayer = (t, config) => {
369
369
  ['music.163.com.*artist.*id=(\\d+)', 'netease', 'artist'],
370
370
  ['music.163.com.*playlist.*id=(\\d+)', 'netease', 'playlist'],
371
371
  ['music.163.com.*discover/toplist.*id=(\\d+)', 'netease', 'playlist'],
372
- ['y.qq.com.*song/(\\w+).html', 'tencent', 'song'],
373
- ['y.qq.com.*album/(\\w+).html', 'tencent', 'album'],
374
- ['y.qq.com.*singer/(\\w+).html', 'tencent', 'artist'],
375
- ['y.qq.com.*playsquare/(\\w+).html', 'tencent', 'playlist'],
376
- ['y.qq.com.*playlist/(\\w+).html', 'tencent', 'playlist'],
372
+ ['y.qq.com.*song/(\\w+)(.html)?', 'tencent', 'song'],
373
+ ['y.qq.com.*album/(\\w+)(.html)?', 'tencent', 'album'],
374
+ ['y.qq.com.*singer/(\\w+)(.html)?', 'tencent', 'artist'],
375
+ ['y.qq.com.*playsquare/(\\w+)(.html)?', 'tencent', 'playlist'],
376
+ ['y.qq.com.*playlist/(\\w+)(.html)?', 'tencent', 'playlist'],
377
377
  ['xiami.com.*song/(\\w+)', 'xiami', 'song'],
378
378
  ['xiami.com.*album/(\\w+)', 'xiami', 'album'],
379
379
  ['xiami.com.*artist/(\\w+)', 'xiami', 'artist'],
package/.eslintrc.cjs DELETED
@@ -1,32 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- env: {
4
- browser: true,
5
- commonjs: true,
6
- es6: true,
7
- node: true
8
- },
9
- extends: [
10
- 'standard',
11
- 'plugin:@typescript-eslint/recommended',
12
- 'plugin:vue/vue3-recommended',
13
- 'plugin:chai-friendly/recommended'
14
- ],
15
- plugins: [
16
- '@typescript-eslint',
17
- 'vue',
18
- 'chai-friendly'
19
- ],
20
- parserOptions: {
21
- ecmaVersion: 12
22
- },
23
- rules: {
24
- camelcase: 'off',
25
- 'n/no-callback-literal': 'off',
26
- '@typescript-eslint/ban-types': 'off',
27
- '@typescript-eslint/ban-ts-comment': 'off',
28
- '@typescript-eslint/no-var-requires': 'off',
29
- '@typescript-eslint/no-unused-vars': 'off',
30
- 'prefer-const': 'off'
31
- }
32
- }