hexo-theme-shokax 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/LICENSE +68 -81
  2. package/README.md +8 -6
  3. package/UsageRestrictions.md +21 -0
  4. package/_config.yml +9 -16
  5. package/layout/_mixin/comment.pug +2 -1
  6. package/layout/_mixin/widgets.pug +2 -1
  7. package/layout/_partials/layout.pug +8 -8
  8. package/layout/post.pug +2 -1
  9. package/package.json +8 -4
  10. package/scripts/generaters/script.js +33 -7
  11. package/scripts/plugin/check.js +30 -0
  12. package/scripts/plugin/index.js +5 -0
  13. package/source/css/_common/components/tags/tabs.styl +0 -2
  14. package/source/js/_app/{components.js → components/sidebar.js} +26 -27
  15. package/source/js/_app/fireworks.js +28 -42
  16. package/source/js/_app/globals/globalVars.js +26 -0
  17. package/source/js/_app/globals/handles.js +105 -0
  18. package/source/js/_app/globals/themeColor.js +48 -0
  19. package/source/js/_app/globals/thirdparty.js +60 -0
  20. package/source/js/_app/globals/tools.js +75 -0
  21. package/source/js/_app/library/anime.js +85 -0
  22. package/source/js/_app/library/dom.js +22 -0
  23. package/source/js/_app/library/loadFile.js +32 -0
  24. package/source/js/_app/library/proto.js +105 -0
  25. package/source/js/_app/library/scriptPjax.js +57 -0
  26. package/source/js/_app/library/storage.js +11 -0
  27. package/source/js/_app/{vue.js → library/vue.js} +6 -6
  28. package/source/js/_app/page/comment.js +19 -0
  29. package/source/js/_app/page/common.js +57 -0
  30. package/source/js/_app/page/fancybox.js +59 -0
  31. package/source/js/_app/page/post.js +232 -0
  32. package/source/js/_app/page/search.js +111 -0
  33. package/source/js/_app/page/tab.js +50 -0
  34. package/source/js/_app/pjax/domInit.js +68 -0
  35. package/source/js/_app/pjax/refresh.js +42 -0
  36. package/source/js/_app/pjax/siteInit.js +34 -0
  37. package/source/js/_app/player.js +87 -91
  38. package/source/js/_app/global.js +0 -314
  39. package/source/js/_app/library.js +0 -312
  40. package/source/js/_app/page.js +0 -674
package/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
1
+ GNU AFFERO GENERAL PUBLIC LICENSE
2
+ Version 3, 19 November 2007
3
3
 
4
4
  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
5
  Everyone is permitted to copy and distribute verbatim copies
@@ -7,17 +7,15 @@
7
7
 
8
8
  Preamble
9
9
 
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
10
+ The GNU Affero General Public License is a free, copyleft license for
11
+ software and other kinds of works, specifically designed to ensure
12
+ cooperation with the community in the case of network server software.
12
13
 
13
14
  The licenses for most software and other practical works are designed
14
15
  to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
+ our General Public Licenses are intended to guarantee your freedom to
16
17
  share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
18
+ software for all its users.
21
19
 
22
20
  When we speak of free software, we are referring to freedom, not
23
21
  price. Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you
26
24
  want it, that you can change the software or use pieces of it in new
27
25
  free programs, and that you know you can do these things.
28
26
 
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
27
+ Developers that use our General Public Licenses protect your rights
28
+ with two steps: (1) assert copyright on the software, and (2) offer
29
+ you this License which gives you legal permission to copy, distribute
30
+ and/or modify the software.
31
+
32
+ A secondary benefit of defending all users' freedom is that
33
+ improvements made in alternate versions of the program, if they
34
+ receive widespread use, become available for other developers to
35
+ incorporate. Many developers of free software are heartened and
36
+ encouraged by the resulting cooperation. However, in the case of
37
+ software used on network servers, this result may fail to come about.
38
+ The GNU General Public License permits making a modified version and
39
+ letting the public access it on a server without ever releasing its
40
+ source code to the public.
41
+
42
+ The GNU Affero General Public License is designed specifically to
43
+ ensure that, in such cases, the modified source code becomes available
44
+ to the community. It requires the operator of a network server to
45
+ provide the source code of the modified version running there to the
46
+ users of that server. Therefore, public use of a modified version, on
47
+ a publicly accessible server, gives the public access to the source
48
+ code of the modified version.
49
+
50
+ An older license, called the Affero General Public License and
51
+ published by Affero, was designed to accomplish similar goals. This is
52
+ a different license, not a version of the Affero GPL, but Affero has
53
+ released a new version of the Affero GPL which permits relicensing under
54
+ this license.
67
55
 
68
56
  The precise terms and conditions for copying, distribution and
69
57
  modification follow.
@@ -72,7 +60,7 @@ modification follow.
72
60
 
73
61
  0. Definitions.
74
62
 
75
- "This License" refers to version 3 of the GNU General Public License.
63
+ "This License" refers to version 3 of the GNU Affero General Public License.
76
64
 
77
65
  "Copyright" also means copyright-like laws that apply to other kinds of
78
66
  works, such as semiconductor masks.
@@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey
549
537
  the Program, the only way you could satisfy both those terms and this
550
538
  License would be to refrain entirely from conveying the Program.
551
539
 
552
- 13. Use with the GNU Affero General Public License.
540
+ 13. Remote Network Interaction; Use with the GNU General Public License.
541
+
542
+ Notwithstanding any other provision of this License, if you modify the
543
+ Program, your modified version must prominently offer all users
544
+ interacting with it remotely through a computer network (if your version
545
+ supports such interaction) an opportunity to receive the Corresponding
546
+ Source of your version by providing access to the Corresponding Source
547
+ from a network server at no charge, through some standard or customary
548
+ means of facilitating copying of software. This Corresponding Source
549
+ shall include the Corresponding Source for any work covered by version 3
550
+ of the GNU General Public License that is incorporated pursuant to the
551
+ following paragraph.
553
552
 
554
553
  Notwithstanding any other provision of this License, you have
555
554
  permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
555
+ under version 3 of the GNU General Public License into a single
557
556
  combined work, and to convey the resulting work. The terms of this
558
557
  License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
558
+ but the work with which it is combined will remain governed by version
559
+ 3 of the GNU General Public License.
562
560
 
563
561
  14. Revised Versions of this License.
564
562
 
565
563
  The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
564
+ the GNU Affero General Public License from time to time. Such new versions
565
+ will be similar in spirit to the present version, but may differ in detail to
568
566
  address new problems or concerns.
569
567
 
570
568
  Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
569
+ Program specifies that a certain numbered version of the GNU Affero General
572
570
  Public License "or any later version" applies to it, you have the
573
571
  option of following the terms and conditions either of that numbered
574
572
  version or of any later version published by the Free Software
575
573
  Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
574
+ GNU Affero General Public License, you may choose any version ever published
577
575
  by the Free Software Foundation.
578
576
 
579
577
  If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
578
+ versions of the GNU Affero General Public License can be used, that proxy's
581
579
  public statement of acceptance of a version permanently authorizes you
582
580
  to choose that version for the Program.
583
581
 
@@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found.
635
633
  Copyright (C) <year> <name of author>
636
634
 
637
635
  This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
636
+ it under the terms of the GNU Affero General Public License as published by
639
637
  the Free Software Foundation, either version 3 of the License, or
640
638
  (at your option) any later version.
641
639
 
642
640
  This program is distributed in the hope that it will be useful,
643
641
  but WITHOUT ANY WARRANTY; without even the implied warranty of
644
642
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
643
+ GNU Affero General Public License for more details.
646
644
 
647
- You should have received a copy of the GNU General Public License
645
+ You should have received a copy of the GNU Affero General Public License
648
646
  along with this program. If not, see <https://www.gnu.org/licenses/>.
649
647
 
650
648
  Also add information on how to contact you by electronic and paper mail.
651
649
 
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
650
+ If your software can interact with users remotely through a computer
651
+ network, you should also make sure that it provides a way for users to
652
+ get its source. For example, if your program is a web application, its
653
+ interface could display a "Source" link that leads users to an archive
654
+ of the code. There are many ways you could offer source, and different
655
+ solutions will be better for different programs; see section 13 for the
656
+ specific requirements.
663
657
 
664
658
  You should also get your employer (if you work as a programmer) or school,
665
659
  if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <https://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <https://www.gnu.org/licenses/why-not-lgpl.html>.
660
+ For more information on this, and how to apply and follow the GNU AGPL, see
661
+ <https://www.gnu.org/licenses/>.
package/README.md CHANGED
@@ -1,5 +1,3 @@
1
- 如果你访问的仓库地址是**zkz098/hexo-theme-shokaX**,请转为访问最新地址: [theme-shoka-x/hexo-theme-shokaX](https://github.com/theme-shoka-x/hexo-theme-shokaX)
2
-
3
1
  # hexo-theme-shokaX
4
2
  [![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
3
  ![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX)
@@ -50,7 +48,7 @@ github仓库建议通过右边的 releases 下载,步骤为:
50
48
  - 解压即可作为主题使用
51
49
 
52
50
  ## 🛠️二次开发
53
- 二次开发文档正在筹备中...
51
+ [ShokaX官方开发文档](https://docs.kaitaku.xyz/develop/basic/)
54
52
 
55
53
  参与开发建议阅读的文档:
56
54
  - [Hexo 官方文档](https://hexo.io/zh-cn/docs/templates)
@@ -60,12 +58,16 @@ github仓库建议通过右边的 releases 下载,步骤为:
60
58
  - [Easy hexo](https://easyhexo.com/)
61
59
 
62
60
  # 许可证
63
- 许可证: GPL 3 or later \
61
+ 许可证: AGPL 3 or later \
64
62
  [![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)
65
63
 
66
64
  ## 特别说明
67
- GPL许可证主要目的是限制修改后的分发行为,避免未经许可的二次修改封装商业行为 \
68
- 仅修改源代码并不需要开源,因为未进行分发行为
65
+ AGPL许可证主要目的是限制修改后的分发行为,避免未经许可的二次修改封装商业行为 \
66
+ 仅修改源代码**需要**开源,因为根据AGPL许可,搭建网站需要开源修改部分
67
+
68
+ ## 使用特殊说明
69
+ 依照AGPLv3 Section 7,我们添加了一些附加条款:
70
+ 请查看[使用限制](./UsageRestrictions.md),使用ShokaX则默认您已知晓此文件内容
69
71
 
70
72
  # 致谢名单
71
73
  ## 开源项目
@@ -0,0 +1,21 @@
1
+ # 使用限制
2
+ 感谢您使用 ShokaX 及其子项目。在使用之前,请仔细阅读并遵守以下使用限制。使用 ShokaX 及其子项目,表示您同意遵守以下规定:
3
+ ## 归属权
4
+ 1. 您需要保留页脚和控制台的主题链接。 (根据 `AGPLv3 七 (b)`)
5
+ 2. 分发 ShokaX 及其子项目的修改版本时,必须以合理的方式更改软件名称或版本号,以将其与原始版本区分开来。(根据 `AGPLv3 七 (c)`)
6
+
7
+ ## 责任
8
+ 1. ShokaX 及其子项目仅提供了网页的框架,对于网页内容不会也无法进行审核,因此网页内容导致的一切问题与 ShokaX 项目组无关。我们**鼓励**您发表有用且合理合法的信息。(根据`AGPLv3 七 (a)`)
9
+ 2. ShokaX 项目组**可以**在不进行任何事先告知的情况下对API进行更名、重构、添加和删除等操作,ShokaX 项目组会**尽可能**事先在文档及其他渠道中通知以便用户平滑升级。(根据`AGPLv3 七 (a)`)
10
+ 3. 使用 ShokaX 及其子项目则意味着 ShokaX 项目组不承担由 ShokaX 导致的一切问题的责任,ShokaX 项目组也不作出任何明示或暗示的保证 (根据`AGPLv3 七 (a)`)
11
+
12
+ ## 商业使用
13
+ 1. ShokaX 项目组不会提供企业或商业咨询服务,任何使用者获取帮助的方式都是一致的 (仅为声明)
14
+ 2. ShokaX 项目组不会制作收费版或高级版的项目,ShokaX及其子项目有且只有社区版 (仅为声明)
15
+
16
+ ## 处理方式
17
+ 如果您违反了上述使用限制和GPLv3的任何规定,ShokaX 项目组保留采取以下措施之一或多个的权利:
18
+ - 发出警告通知并要求立即纠正违规行为;(根据`AGPLv3 八`)
19
+ - 暂停或终止您对 ShokaX 及其子项目的使用权限并取消GPLv3授予您的权利;(根据`AGPLv3 八`)
20
+ - 取消您获取 ShokaX 社区支持和进行协作的权利;(社区管理)
21
+ - 追究法律责任,包括要求赔偿因违规行为给 ShokaX 项目组造成的损失。(依照相关法律而定)
package/_config.yml CHANGED
@@ -63,13 +63,13 @@ visitor:
63
63
  baiduAnalytics: false
64
64
  googleAnalytics: false
65
65
 
66
- darkmode: false
66
+ darkmode: true
67
67
  auto_dark: # 自动亮/暗模式
68
68
  enable: true #是否开启
69
69
  start: 20 #开始时间
70
70
  end: 7 #结束时间
71
71
 
72
- auto_scroll: true
72
+ auto_scroll: false
73
73
 
74
74
  loader:
75
75
  start: true # 进入页面时显示加载动画
@@ -253,7 +253,7 @@ widgets:
253
253
  recent_comments: true
254
254
 
255
255
  footer:
256
- # Specify the date when the site was setup. If not defined, current year will be used.
256
+ # Specify the date when the site was set up. If not defined, current year will be used.
257
257
  since: 2022
258
258
  icon:
259
259
  name: sakura rotate
@@ -278,7 +278,7 @@ post:
278
278
 
279
279
  # 文章是否失效
280
280
  outime:
281
- enable: true
281
+ enable: false
282
282
  days: 90 # 超过 90 天文章失效
283
283
 
284
284
  reward:
@@ -349,7 +349,6 @@ quicklink:
349
349
  #! ---------------------------------------------------------------
350
350
  #! DO NOT EDIT THE FOLLOWING `vendors` SETTINGS
351
351
  #! UNLESS YOU KNOW WHAT YOU ARE DOING
352
- #! Script dependencies will be combined with jsDelivr (cdn.jsdelivr.net)
353
352
  #! ---------------------------------------------------------------
354
353
  advVendors:
355
354
  enable: true
@@ -377,13 +376,11 @@ advVendors:
377
376
  src: bytedance:??jquery/3.5.1/jquery.min.js,fancybox/3.5.7/jquery.fancybox.min.js,justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js
378
377
  async: true
379
378
  copy_tex:
380
- src: bytedance:KaTeX/0.12.0/contrib/copy-tex.min.js
379
+ src: bytedance:KaTeX/0.15.2/contrib/copy-tex.min.js
381
380
  async: true
382
- chart:
383
- src: npm:frappe-charts@1.5.0/dist/frappe-charts.min.iife.js
384
381
  css:
385
382
  katex:
386
- src: npm:katex@0.12.0/dist/katex.min.css
383
+ src: npm:katex@0.16.7/dist/katex.min.css
387
384
  comment:
388
385
  src: css/comment.css
389
386
  fancybox:
@@ -399,15 +396,12 @@ vendorsList:
399
396
  - quicklink
400
397
  - fancybox
401
398
  - copy_tex
402
- - chart
403
399
 
404
400
  vendors:
405
401
  css:
406
- # katex: npm/katex@0.12.0/dist/katex.min.css
407
- katex: npm/katex@0.12.0/dist/katex.min.css # ok
402
+ katex: npm/katex@0.16.7/dist/katex.min.css # ok
408
403
  comment: css/comment.css
409
404
  fancybox: combine/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css,npm/justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css # notok
410
- # fancybox: npm/fancybox/justifiedGallery.min.css
411
405
 
412
406
  js:
413
407
  pace: npm/pace-js@1.0.2/pace.min.js # ok
@@ -419,8 +413,7 @@ vendors:
419
413
  lazyload: npm/lozad@1/dist/lozad.min.js # ok
420
414
  quicklink: npm/quicklink@2/dist/quicklink.umd.js # ok
421
415
  fancybox: combine/npm/jquery@3.5.1/dist/jquery.min.js,npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js,npm/justifiedGallery@3.8.1/dist/js/jquery.justifiedGallery.min.js # notok
422
- # fancybox: npm/fancybox/jquery.justifiedGallery.min.js
423
- valine: gh/amehime/MiniValine@4.2.2-beta10/dist/MiniValine.min.js
424
- copy_tex: npm/katex@0.12.0/dist/contrib/copy-tex.min.js # ok
416
+ valine: gh/amehime/MiniValine@4.2.2-beta10/dist/MiniValine.min.js # TODO 弃用
417
+ copy_tex: npm/katex@0.16.7/dist/contrib/copy-tex.min.js # ok
425
418
  chart: npm/frappe-charts@1.5.0/dist/frappe-charts.min.iife.min.js # ok
426
419
 
@@ -34,7 +34,8 @@ mixin CommentRender()
34
34
  wordLimit: #{theme.waline.wordLimit},
35
35
  pageSize: #{theme.waline.pageSize},
36
36
  pageview: #{theme.waline.pageview},
37
- path: path
37
+ path: path,
38
+ dark: 'html[data-theme="dark"]'
38
39
  });
39
40
  }, 1000)
40
41
  else if gt
@@ -21,7 +21,8 @@ mixin WRender(item)
21
21
  +field(item)
22
22
  if theme.widgets.recent_comments
23
23
  div(class="rpost pjax")
24
- h2 最新评论
24
+ h2
25
+ != __('index.recent_comments')
25
26
  ul(class="leancloud-recent-comment" id="new-comment")
26
27
  if tk || waline
27
28
  li(v-for="com in coms" class="item")
@@ -83,15 +83,15 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
83
83
  empty: "!{__('search.empty')}",
84
84
  stats: "!{__('search.stats')}"
85
85
  },
86
- valine: `#{page.valine ? _safedump(page.valine) : 'true'}`,
87
- chart: `#{page.chart ? 'true' : 'false'}`,
88
- copy_tex: `#{page.math ? 'true' : 'false'}`,
89
- katex: `#{page.math ? 'true' : 'false'}`,
90
- mermaid: `#{page.mermaid ? 'true' : 'false'}`,
86
+ valine: #{page.valine ? _safedump(page.valine) : true},
87
+ chart: #{!!page.chart},
88
+ copy_tex: #{!!page.math},
89
+ katex: #{!!page.math},
90
+ mermaid: #{!!page.mermaid},
91
91
  audio: `#{_safedump(page.audio)}`,
92
- fancybox: `#{page.fancybox !== false ? 'true' : 'false'}`,
93
- nocopy: `#{page.nocopy ? 'true' : 'false'}`,
94
- outime: `#{page.outime !== false ? 'true' : 'false'}`,
92
+ fancybox: #{page.fancybox !== false},
93
+ nocopy: #{!!page.nocopy},
94
+ outime: #{page.outime !== false},
95
95
  template: `#{__('outime.template')}`,
96
96
  quiz: {
97
97
  choice: `#{__('quiz.choice')}`,
package/layout/post.pug CHANGED
@@ -11,7 +11,8 @@ block title
11
11
  each cat in page.categories.toArray()
12
12
  - var cat_list = cat.name + comma + cat_list
13
13
  - var comma = ' - '
14
- - var page_title = page.title + ' - ' + cat_list
14
+ if cat_list.length !== 0
15
+ - var page_title = page.title + ' - ' + cat_list
15
16
  != `${page_title}`
16
17
 
17
18
  block header
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
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
- "license": "GPL-3.0-or-later",
8
+ "license": "AGPL-3.0-or-later",
9
9
  "scripts": {
10
10
  "test": "tsc",
11
11
  "build": "pnpm install && tsc"
@@ -17,7 +17,7 @@
17
17
  "@types/js-yaml": "^4.0.5",
18
18
  "@types/lozad": "^1.16.1",
19
19
  "@types/node": "^20.2.3",
20
- "@typescript-eslint/eslint-plugin": "^5.59.7",
20
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
21
21
  "@typescript-eslint/parser": "^5.59.7",
22
22
  "eslint": "^8.41.0",
23
23
  "eslint-config-standard": "*",
@@ -35,5 +35,9 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "js-yaml": "^4.1.0"
38
- }
38
+ },
39
+ "engines": {
40
+ "node": ">=18.0.0"
41
+ },
42
+ "engineStrict": true
39
43
  }
@@ -5,6 +5,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const package_json_1 = __importDefault(require("../../package.json"));
7
7
  const fs = require("hexo-fs");
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ function findJsFile(path) {
10
+ console.log(path);
11
+ let result = [];
12
+ fs.readdirSync(path).forEach((item) => {
13
+ console.log(item);
14
+ if (!item.endsWith('js')) {
15
+ result = result.concat(findJsFile(node_path_1.default.join(path, item)));
16
+ }
17
+ else {
18
+ if (item.indexOf('player') === -1 && item.indexOf('fireworks') === -1) {
19
+ console.log('push');
20
+ result.push(node_path_1.default.join(path, item));
21
+ }
22
+ }
23
+ });
24
+ return result;
25
+ }
8
26
  hexo.extend.generator.register('script', function (locals) {
9
27
  const log = hexo.log || console.log;
10
28
  const config = hexo.config;
@@ -59,13 +77,21 @@ hexo.extend.generator.register('script', function (locals) {
59
77
  siteConfig.audio = theme.audio;
60
78
  }
61
79
  let text = '';
62
- ['library', 'global', 'page', 'vue', 'components'].forEach(function (item) {
63
- if (fs.existsSync(`themes/shokaX/source/js/_app/${item}.js`)) {
64
- text += fs.readFileSync(`themes/shokaX/source/js/_app/${item}.js`).toString();
65
- }
66
- else {
67
- text += fs.readFileSync(`node_modules/hexo-theme-shokax/source/js/_app/${item}.js`).toString();
68
- }
80
+ let path = '';
81
+ if (fs.existsSync('themes/shokaX/source/js/_app/library/dom.js')) {
82
+ path = 'themes/shokaX/source/js/_app';
83
+ }
84
+ else {
85
+ path = 'node_modules/hexo-theme-shokax/source/js/_app';
86
+ }
87
+ let files = findJsFile(node_path_1.default.join(path, 'library'));
88
+ files = files.concat(findJsFile(node_path_1.default.join(path, 'globals')));
89
+ files = files.concat(findJsFile(node_path_1.default.join(path, 'page')));
90
+ files = files.concat(findJsFile(node_path_1.default.join(path, 'pjax')));
91
+ files = files.concat(findJsFile(node_path_1.default.join(path, 'components')));
92
+ console.log(files);
93
+ files.forEach(function (item) {
94
+ text += fs.readFileSync(item).toString();
69
95
  });
70
96
  if (!theme.experiments?.noPlayer) {
71
97
  if (fs.existsSync('themes/shokaX/source/js/_app/player.js')) {
@@ -0,0 +1,30 @@
1
+ let findProblem = false;
2
+ hexo.on('generateBefore', function () {
3
+ if (hexo.config.highlight.enable || hexo.config.prismjs.enable) {
4
+ findProblem = true;
5
+ hexo.log.error('[SXEC 101] Highlight.js or Prismjs enabled. The code block will render incomplete');
6
+ }
7
+ if (!hexo.config.autoprefixer || !hexo.config.markdown) {
8
+ findProblem = true;
9
+ hexo.log.error(`[SXEC 102] Critical rendering plugins are missing or incorrectly configured.
10
+ Some features will be disabled or render incorrectly`);
11
+ }
12
+ if (parseInt(process.version.match(/\d{2,3}/)[0]) < 18) {
13
+ findProblem = true;
14
+ hexo.log.error('[SXEC 103] Too old Node.js version, install the latest LTS version');
15
+ }
16
+ if (!hexo.config.title || !hexo.config.description || !hexo.config.language || !hexo.config.timezone || !hexo.config.url) {
17
+ findProblem = true;
18
+ hexo.log.warn('[SXEC 201] Essential information(title, desc, lang, etc) config incorrectly, Page will render incorrectly');
19
+ }
20
+ if (hexo.theme.config.gitalk.clientID || hexo.theme.config.giscus.repo) {
21
+ hexo.log.info('You are using an untested feature and there may be undiscovered issues');
22
+ }
23
+ });
24
+ hexo.on('generateAfter', function () {
25
+ if (findProblem) {
26
+ hexo.log.warn(`The environment check found some problems that can lead to rendering errors, effect errors,
27
+ performance degradation, not working correctly, etc`);
28
+ hexo.log.warn('ShokaX has output them into console, read them to get more information. You can search error code in docs(For example, SXEC 101)');
29
+ }
30
+ });
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /*!
3
+ index.js in next-theme/hexo-theme-next by theme-next
4
+ under GNU AFFERO GENERAL PUBLIC LICENSE v3.0
5
+ https://github.com/next-theme/hexo-theme-next/blob/master/LICENSE.md
6
+ */
2
7
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
9
  };
@@ -44,8 +44,6 @@
44
44
  }
45
45
 
46
46
  &.active::before {
47
- left: 0;
48
- right: 0;
49
47
  border-bottom-color: var(--primary-color);
50
48
  }
51
49
  }