hexo-theme-shokax 0.5.3 → 0.5.4

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/_config.yml CHANGED
@@ -224,7 +224,7 @@ summary:
224
224
 
225
225
  # 由于 Hexo 的 ESM 模块支持存在严重缺陷,ShokaX 无法引入自动索引流程,Pagefind 构建需要通过 CLI 手动执行
226
226
  # 在每次 generate 完成后需要执行`pnpm dlx pagefind --site public`,再 deploy,否则 Pagefind 无法正常工作
227
- # 参见:<todo: 链接到 ShokaX 文档>
227
+ # 参见:https://docs.shokax.kaitaku.xyz/features/search/#pagefind-%E6%90%9C%E7%B4%A2
228
228
  pagefind: # pagefind 本地搜索 https://pagefind.app/
229
229
  enable: false # 是否启用
230
230
 
@@ -321,7 +321,6 @@ creative_commons:
321
321
  language: deed.zh
322
322
 
323
323
  # bgm
324
- # 不使用请打开noplayer功能
325
324
  audio:
326
325
  # - title: 列表1
327
326
  # list:
@@ -330,9 +329,6 @@ audio:
330
329
  # list:
331
330
  # - https://music.163.com/#/playlist?id=2031842656
332
331
 
333
- # random image api
334
- image_server: # "https://acg.xydwz.cn/api/api.php"
335
-
336
332
  # Algolia Search
337
333
  # For more information: https://www.algolia.com
338
334
  search:
@@ -1,5 +1,5 @@
1
1
  - var temp = post.lang || config.language
2
- article(itemscope itemtype="http://schema.org/Article" class="post block" lang=temp)
2
+ article(itemscope itemtype="http://schema.org/Article" class="post block" data-pagefind-body lang=temp)
3
3
  link(itemprop="mainEntityOfPage" href!=post.permalink)
4
4
  span(hidden itemprop="author" itemscope itemtype="http://schema.org/Person")
5
5
  meta(itemprop="image" content=url_for(theme.statics + theme.assets + '/' + theme.sidebar.avatar))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
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",
@@ -28,6 +28,7 @@ async function isPackageDeclared(packageName) {
28
28
  return pkg.dependencies && pkg.dependencies[packageName] || pkg.devDependencies && pkg.devDependencies[packageName];
29
29
  }
30
30
  hexo.on("generateBefore", async function() {
31
+ const theme = hexo.theme.config;
31
32
  if (hexo.config.syntax_highlighter) {
32
33
  findSevereProblem = true;
33
34
  findProblem = true;
@@ -38,7 +39,7 @@ hexo.on("generateBefore", async function() {
38
39
  findProblem = true;
39
40
  hexo.log.error(`[SXEC 102] Critical rendering plugins are missing or incorrectly configured.
40
41
  Some features will be disabled or render incorrectly.
41
- You should install shokax-uikit, hexo-renderer-aether, and nyx-player to fix this issue.`);
42
+ You can install shokax-uikit, hexo-renderer-aether, and nyx-player to fix this issue.`);
42
43
  }
43
44
  if (parseInt(process.version.match(/\d{2,3}/)[0]) < 20) {
44
45
  findProblem = true;
@@ -47,19 +48,24 @@ You should install shokax-uikit, hexo-renderer-aether, and nyx-player to fix thi
47
48
  if (await isPackageDeclared("hexo-renderer-multi-next-markdown-it")) {
48
49
  findSevereProblem = true;
49
50
  findProblem = true;
50
- hexo.log.error(`[SXEC 110] hexo-renderer-multi-next-markdown-it is not supported in ShokaX 0.5.2 and above, please use hexo-renderer-aether instead!
51
- Are you upgrading your theme without upgrading renderer?`);
51
+ hexo.log.error(`[SXEC 104] hexo-renderer-multi-next-markdown-it is not supported in ShokaX 0.5.2 and above, please use hexo-renderer-aether instead.`);
52
52
  }
53
53
  if (!hexo.config.title || !hexo.config.description || !hexo.config.language || !hexo.config.timezone || !hexo.config.url) {
54
54
  findProblem = true;
55
- hexo.log.warn("[SXEC 201] Essential information(title, desc, lang, etc.) config incorrectly, Page will render incorrectly!");
55
+ hexo.log.warn(`[SXEC 201] Essential information(title, desc, lang, etc.) config incorrectly, Page will render incorrectly.
56
+ Please check your _config.yml file.`);
57
+ }
58
+ if (!theme.modules.tabs && theme.modules.summary.enable) {
59
+ findProblem = true;
60
+ hexo.log.warn(`[SXEC 202] Tabs module is disabled, but summary module is enabled. Summary will unable to be rendered correctly.
61
+ Please enable tabs module in theme config.`);
56
62
  }
57
63
  });
58
64
  hexo.on("generateAfter", function() {
59
65
  if (findSevereProblem) {
60
66
  hexo.log.error(`The environment check found some severe problems that absolutely will cause errors and crashes`);
61
- hexo.log.error(`ShokaX has stop generating, please fix the problems above`);
62
- throw new Error("ShokaX Environment Check Failed, found severe problems");
67
+ hexo.log.error(`ShokaX has stopped generating, please fix the problems above`);
68
+ throw new Error("ShokaX Environment Check Failed, found severe problems. You can search error code in docs(For example, SXEC 101)");
63
69
  }
64
70
  if (findProblem) {
65
71
  hexo.log.warn(`The environment check found some problems that can lead to rendering errors, effect errors,
@@ -21,8 +21,6 @@ export const siteRefresh = async (reload) => {
21
21
  setLocalHash(0)
22
22
  setLocalUrl(window.location.href)
23
23
 
24
- // @ts-ignore
25
- // await import('katex/dist/katex.min.css')
26
24
  await import('katex/dist/contrib/copy-tex.mjs')
27
25
 
28
26
  // 懒加载背景图