hexo-theme-shokax 0.2.10 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +68 -81
- package/README.md +17 -6
- package/UsageRestrictions.md +21 -0
- package/_config.yml +5 -12
- package/layout/_mixin/comment.pug +1 -2
- package/layout/_mixin/widgets.pug +2 -1
- package/layout/_partials/layout.pug +23 -23
- package/package.json +16 -12
- package/scripts/generaters/script.js +29 -8
- package/scripts/helpers/summary_ai.js +0 -1
- package/scripts/plugin/check.js +30 -0
- package/scripts/plugin/index.js +5 -0
- package/source/css/_common/components/tags/tabs.styl +0 -2
- package/source/css/_common/scaffolding/normalize.styl +165 -180
- package/source/js/_app/globals/globalVars.js +26 -0
- package/source/js/_app/globals/handles.js +105 -0
- package/source/js/_app/globals/themeColor.js +48 -0
- package/source/js/_app/globals/thirdparty.js +60 -0
- package/source/js/_app/globals/tools.js +75 -0
- package/source/js/_app/library/anime.js +85 -0
- package/source/js/_app/library/dom.js +22 -0
- package/source/js/_app/library/loadFile.js +32 -0
- package/source/js/_app/library/proto.js +105 -0
- package/source/js/_app/library/scriptPjax.js +57 -0
- package/source/js/_app/library/storage.js +11 -0
- package/source/js/_app/page/comment.js +19 -0
- package/source/js/_app/page/common.js +57 -0
- package/source/js/_app/page/fancybox.js +59 -0
- package/source/js/_app/page/post.js +232 -0
- package/source/js/_app/page/search.js +111 -0
- package/source/js/_app/page/tab.js +50 -0
- package/source/js/_app/pjax/domInit.js +68 -0
- package/source/js/_app/pjax/refresh.js +42 -0
- package/source/js/_app/pjax/siteInit.js +34 -0
- package/source/js/_app/player.js +1 -1
- package/source/js/_app/global.js +0 -314
- package/source/js/_app/library.js +0 -312
- package/source/js/_app/page.js +0 -673
- /package/source/js/_app/{components.js → components/sidebar.js} +0 -0
- /package/source/js/_app/{vue.js → library/vue.js} +0 -0
package/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
GNU GENERAL PUBLIC LICENSE
|
2
|
-
Version 3,
|
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
|
-
|
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.
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
that
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
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
|
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
|
560
|
-
|
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
|
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
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
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
|
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,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# 📣 公告
|
2
|
+
* [ShokaX 正在寻找社区维护者](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/137)
|
2
3
|
|
3
4
|
# hexo-theme-shokaX
|
4
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)
|
@@ -49,8 +50,15 @@ github仓库建议通过右边的 releases 下载,步骤为:
|
|
49
50
|
- 下载 Assets 中的 `Source code(zip)`
|
50
51
|
- 解压即可作为主题使用
|
51
52
|
|
53
|
+
## 📚子项目
|
54
|
+
- [ShokaX docs](https://github.com/theme-shoka-x/shokaX-docs) ShokaX 主题文档 (正在编写中,欢迎加入!)
|
55
|
+
- [HRMNMI](https://github.com/theme-shoka-x/hexo-renderer-multi-next-markdown-it) ShokaX 正在使用的 markdown 渲染器 (等待重构)
|
56
|
+
- [ShokaX CLI](https://github.com/theme-shoka-x/shokaX-CLI) ShokaX 命令行安装程序
|
57
|
+
- [ShokaX Pjax](https://github.com/theme-shoka-x/theme-shokax-pjax) ShokaX 提供的高效 Pjax 实现
|
58
|
+
- [ShokaX Anime](https://github.com/theme-shoka-x/theme-shokax-anime) ShokaX 提供的精简版 Anime.js 实现
|
59
|
+
|
52
60
|
## 🛠️二次开发
|
53
|
-
|
61
|
+
[ShokaX官方开发文档](https://docs.kaitaku.xyz/develop/basic/)
|
54
62
|
|
55
63
|
参与开发建议阅读的文档:
|
56
64
|
- [Hexo 官方文档](https://hexo.io/zh-cn/docs/templates)
|
@@ -60,12 +68,15 @@ github仓库建议通过右边的 releases 下载,步骤为:
|
|
60
68
|
- [Easy hexo](https://easyhexo.com/)
|
61
69
|
|
62
70
|
# 许可证
|
63
|
-
许可证:
|
64
|
-
[![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)
|
71
|
+
许可证: AGPL 3 or later
|
65
72
|
|
66
73
|
## 特别说明
|
67
|
-
|
68
|
-
|
74
|
+
AGPL许可证主要目的是限制修改后的分发行为,避免未经许可的二次修改封装商业行为 \
|
75
|
+
仅修改源代码**需要**开源,因为根据AGPL许可,搭建网站需要开源修改部分
|
76
|
+
|
77
|
+
## 使用特殊说明
|
78
|
+
依照AGPLv3 Section 7,我们添加了一些附加条款:
|
79
|
+
请查看[使用限制](./UsageRestrictions.md),使用ShokaX则默认您已知晓此文件内容
|
69
80
|
|
70
81
|
# 致谢名单
|
71
82
|
## 开源项目
|
@@ -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
@@ -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.
|
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.
|
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
|
-
|
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
|
-
|
423
|
-
|
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
|
|
@@ -21,7 +21,6 @@ mixin CommentRender()
|
|
21
21
|
script(type="module" data-pjax).
|
22
22
|
import { init } from 'https://unpkg.com/@waline/client@v2/dist/waline.mjs';
|
23
23
|
|
24
|
-
const path = document.getElementById("twikoo_visitors").getAttribute("data-path");
|
25
24
|
setTimeout(function () {
|
26
25
|
init({
|
27
26
|
el: '#wcomments',
|
@@ -34,7 +33,7 @@ mixin CommentRender()
|
|
34
33
|
wordLimit: #{theme.waline.wordLimit},
|
35
34
|
pageSize: #{theme.waline.pageSize},
|
36
35
|
pageview: #{theme.waline.pageview},
|
37
|
-
path:
|
36
|
+
path: window.location.pathname,
|
38
37
|
dark: 'html[data-theme="dark"]'
|
39
38
|
});
|
40
39
|
}, 1000)
|
@@ -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")
|
@@ -73,17 +73,17 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
73
73
|
- var ccText = theme.creative_commons.license.toUpperCase()
|
74
74
|
script(data-config type="text/javascript").
|
75
75
|
var LOCAL = {
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
76
|
+
path: `#{_permapath(page.path)}`,
|
77
|
+
favicon: {
|
78
|
+
show: `#{__('favicon.show')}`,
|
79
|
+
hide: `#{__('favicon.hide')}`
|
80
|
+
},
|
81
|
+
search: {
|
82
|
+
placeholder: "!{__('search.placeholder')}",
|
83
|
+
empty: "!{__('search.empty')}",
|
84
|
+
stats: "!{__('search.stats')}"
|
85
|
+
},
|
86
|
+
valine: #{page.valine ? _safedump(page.valine) : true},
|
87
87
|
chart: #{!!page.chart},
|
88
88
|
copy_tex: #{!!page.math},
|
89
89
|
katex: #{!!page.math},
|
@@ -94,18 +94,18 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
|
|
94
94
|
outime: #{page.outime !== false},
|
95
95
|
template: `#{__('outime.template')}`,
|
96
96
|
quiz: {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
97
|
+
choice: `#{__('quiz.choice')}`,
|
98
|
+
multiple: `#{__('quiz.multiple')}`,
|
99
|
+
true_false: `#{__('quiz.true_false')}`,
|
100
|
+
essay: `#{__('quiz.essay')}`,
|
101
|
+
gap_fill: `#{__('quiz.gap_fill')}`,
|
102
|
+
mistake: `#{__('quiz.mistake')}`
|
103
|
+
},
|
104
|
+
ignores: [
|
105
|
+
(uri) => uri.includes('#'),
|
106
|
+
(uri) => new RegExp(LOCAL.path + '$').test(uri),
|
107
|
+
!{JSON.stringify(ignores)}
|
108
|
+
]
|
109
109
|
};
|
110
110
|
|
111
111
|
if theme.polyfill.enable
|
package/package.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.3.1",
|
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": "
|
8
|
+
"license": "AGPL-3.0-or-later",
|
9
9
|
"scripts": {
|
10
10
|
"test": "tsc",
|
11
11
|
"build": "pnpm install && tsc"
|
@@ -16,24 +16,28 @@
|
|
16
16
|
"@types/jquery": "^3.5.16",
|
17
17
|
"@types/js-yaml": "^4.0.5",
|
18
18
|
"@types/lozad": "^1.16.1",
|
19
|
-
"@types/node": "^20.
|
20
|
-
"@typescript-eslint/eslint-plugin": "^
|
21
|
-
"@typescript-eslint/parser": "^
|
22
|
-
"eslint": "^8.
|
19
|
+
"@types/node": "^20.4.4",
|
20
|
+
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
21
|
+
"@typescript-eslint/parser": "^6.2.0",
|
22
|
+
"eslint": "^8.45.0",
|
23
23
|
"eslint-config-standard": "*",
|
24
24
|
"eslint-plugin-import": "^2.27.5",
|
25
|
-
"eslint-plugin-n": "^16.0.
|
25
|
+
"eslint-plugin-n": "^16.0.1",
|
26
26
|
"eslint-plugin-promise": "^6.1.1",
|
27
|
-
"eslint-plugin-vue": "^9.
|
27
|
+
"eslint-plugin-vue": "^9.15.1",
|
28
28
|
"hexo-fs": "^4.1.1",
|
29
|
-
"hexo-util": "^3.0
|
30
|
-
"instantsearch.js": "^4.56.
|
29
|
+
"hexo-util": "^3.1.0",
|
30
|
+
"instantsearch.js": "^4.56.7",
|
31
31
|
"theme-shokax-anime": "^0.0.4",
|
32
32
|
"theme-shokax-pjax": "^0.0.2",
|
33
|
-
"typescript": "^5.
|
33
|
+
"typescript": "^5.1.6",
|
34
34
|
"vue": "^3.3.4"
|
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,8 +5,22 @@ 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
|
+
let result = [];
|
11
|
+
fs.readdirSync(path).forEach((item) => {
|
12
|
+
if (!item.endsWith('js')) {
|
13
|
+
result = result.concat(findJsFile(node_path_1.default.join(path, item)));
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
if (item.indexOf('player') === -1 && item.indexOf('fireworks') === -1) {
|
17
|
+
result.push(node_path_1.default.join(path, item));
|
18
|
+
}
|
19
|
+
}
|
20
|
+
});
|
21
|
+
return result;
|
22
|
+
}
|
8
23
|
hexo.extend.generator.register('script', function (locals) {
|
9
|
-
const log = hexo.log || console.log;
|
10
24
|
const config = hexo.config;
|
11
25
|
const theme = hexo.theme.config;
|
12
26
|
const siteConfig = {
|
@@ -59,13 +73,20 @@ hexo.extend.generator.register('script', function (locals) {
|
|
59
73
|
siteConfig.audio = theme.audio;
|
60
74
|
}
|
61
75
|
let text = '';
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
76
|
+
let path;
|
77
|
+
if (fs.existsSync('themes/shokaX/source/js/_app/library/dom.js')) {
|
78
|
+
path = 'themes/shokaX/source/js/_app';
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
path = 'node_modules/hexo-theme-shokax/source/js/_app';
|
82
|
+
}
|
83
|
+
let files = findJsFile(node_path_1.default.join(path, 'library'));
|
84
|
+
files = files.concat(findJsFile(node_path_1.default.join(path, 'globals')));
|
85
|
+
files = files.concat(findJsFile(node_path_1.default.join(path, 'page')));
|
86
|
+
files = files.concat(findJsFile(node_path_1.default.join(path, 'pjax')));
|
87
|
+
files = files.concat(findJsFile(node_path_1.default.join(path, 'components')));
|
88
|
+
files.forEach(function (item) {
|
89
|
+
text += fs.readFileSync(item).toString();
|
69
90
|
});
|
70
91
|
if (!theme.experiments?.noPlayer) {
|
71
92
|
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
|
+
});
|
package/scripts/plugin/index.js
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
+
/*!
|
3
|
+
index.js in next-theme/hexo-theme-next by next-theme
|
4
|
+
under GNU AFFERO GENERAL PUBLIC LICENSE v3.0 OR LATER
|
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
|
};
|