hexo-theme-shokax 0.4.9 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
package/_config.yml CHANGED
@@ -365,11 +365,11 @@ vendors:
365
365
  source: cdnjs
366
366
  url: pace/1.2.4/pace.min.js
367
367
  sri: "sha384-k6YtvFUEIuEFBdrLKJ3YAUbBki333tj1CSUisai5Cswsg9wcLNaPzsTHDswp4Az8"
368
- async_js:
369
368
  jquery:
370
369
  source: cdnjs
371
370
  url: jquery/3.5.1/jquery.min.js
372
371
  sri: "sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2"
372
+ async_js:
373
373
  fancybox:
374
374
  source: cdnjs
375
375
  url: fancybox/3.5.7/jquery.fancybox.min.js
@@ -129,6 +129,8 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
129
129
  != partial('_partials/third-party/google-analytics.pug', {}, {cache: true})
130
130
 
131
131
  != vendor_js('pace')
132
+ != vendor_js('jquery')
133
+
132
134
  if theme.polyfill.enable
133
135
  script(src=`https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=4.8.0&features=${theme.polyfill.features}` defer)
134
136
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
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
8
  "license": "AGPL-3.0-or-later",
9
- "packageManager": "pnpm@9.4.0",
9
+ "packageManager": "pnpm@9.5.0",
10
10
  "scripts": {
11
11
  "test": "tsc --build --verbose",
12
12
  "build": "node ./toolbox/compiler.mjs"
@@ -16,40 +16,37 @@
16
16
  "@types/jquery": "^3.5.30",
17
17
  "@types/js-yaml": "^4.0.9",
18
18
  "@types/katex": "^0.16.7",
19
- "@types/node": "^20.14.9",
19
+ "@types/node": "^20.14.11",
20
20
  "@types/quicklink": "^2.3.4",
21
- "@typescript-eslint/eslint-plugin": "^7.15.0",
22
- "@typescript-eslint/parser": "^7.15.0",
23
- "eslint": "^9.6.0",
21
+ "@typescript-eslint/eslint-plugin": "^7.16.1",
22
+ "@typescript-eslint/parser": "^7.16.1",
23
+ "eslint": "^9.7.0",
24
24
  "eslint-config-standard": "~17",
25
- "eslint-plugin-import": "^2.29.1",
26
- "eslint-plugin-n": "^17.9.0",
27
- "eslint-plugin-promise": "^6.4.0",
28
25
  "eslint-plugin-vue": "^9.27.0",
29
26
  "typescript": "^5.5.3"
30
27
  },
31
28
  "dependencies": {
32
29
  "@algolia/client-search": "^4.24.0",
33
- "@waline/client": "^3.2.6",
30
+ "@waline/client": "^3.3.0",
34
31
  "algoliasearch": "4.24.0",
35
32
  "esbuild": "^0.23.0",
36
33
  "hexo": "^7.3.0",
37
34
  "hexo-algoliasearch": "^2.0.1",
38
35
  "hexo-feed": "^1.1.2",
39
36
  "hexo-fs": "^4.1.3",
40
- "hexo-pagination": "^3.0.0",
37
+ "hexo-pagination": "^4.0.0",
41
38
  "hexo-renderer-pug": "^3.0.0",
42
39
  "hexo-util": "^3.3.0",
43
- "instantsearch.js": "^4.73.0",
40
+ "instantsearch.js": "^4.73.2",
44
41
  "js-yaml": "^4.1.0",
45
42
  "katex": "^0.16.11",
46
- "mouse-firework": "^0.0.5",
43
+ "mouse-firework": "^0.0.6",
47
44
  "quicklink": "^2.3.0",
48
- "theme-shokax-anime": "^0.0.6",
45
+ "theme-shokax-anime": "^0.0.7",
49
46
  "theme-shokax-pjax": "^0.0.3",
50
- "twikoo": "^1.6.36",
47
+ "twikoo": "^1.6.38",
51
48
  "unlazy": "^0.11.3",
52
- "vue": "^3.4.31"
49
+ "vue": "^3.4.32"
53
50
  },
54
51
  "engines": {
55
52
  "node": ">=18.0.0"
@@ -124,7 +124,7 @@ export const sidebarTOC = () => {
124
124
  while (!parent.matches('.contents')) {
125
125
  if (parent.matches('li')) {
126
126
  parent.addClass('active')
127
- const t = document.querySelector(parent.querySelector('a.toc-link').getAttribute('href'))
127
+ const t = document.querySelector(decodeURIComponent(parent.querySelector('a.toc-link').getAttribute('href')))
128
128
  if (t) {
129
129
  t.addClass('active')
130
130
  }
@@ -68,7 +68,7 @@ export const scrollHandle = () => {
68
68
  toolBtn.toggleClass('affix', startScroll)
69
69
  // 控制侧边栏的显示隐藏,当滚动高度大于 headerHight 且窗口宽度大于 991px 时显示
70
70
  siteBrand.toggleClass('affix', startScroll)
71
- sideBar.toggleClass('affix', window.scrollY > headerHight && document.body.offsetWidth > 991)
71
+ sideBar.toggleClass('affix', window.scrollY > headerHight && document.body.offsetWidth >= 991)
72
72
  // 初始化滚动时导航栏的显示方向
73
73
  if (typeof scrollAction.y === 'undefined') {
74
74
  scrollAction.y = window.scrollY
@@ -7,68 +7,70 @@ export const postFancybox = (p:string) => {
7
7
  if (document.querySelector(p + ' .md img')) {
8
8
  vendorCss('fancybox')
9
9
  vendorCss('justifiedGallery')
10
- vendorJs('jquery')
11
- vendorJs('justifiedGallery')
12
- vendorJs('fancybox', () => {
13
- const q = jQuery.noConflict()
10
+ vendorJs('jquery', ()=>{
11
+ vendorJs('justifiedGallery',()=>{
12
+ vendorJs('fancybox', () => {
13
+ const q = jQuery.noConflict()
14
14
 
15
- $dom.each(p + ' p.gallery', (element) => {
16
- const box = document.createElement('div')
17
- box.className = 'gallery'
18
- box.setAttribute('data-height', String(element.getAttribute('data-height') || 220))
15
+ $dom.each(p + ' p.gallery', (element) => {
16
+ const box = document.createElement('div')
17
+ box.className = 'gallery'
18
+ box.setAttribute('data-height', String(element.getAttribute('data-height') || 220))
19
19
 
20
- box.innerHTML = element.innerHTML.replace(/<br>/g, '')
20
+ box.innerHTML = element.innerHTML.replace(/<br>/g, '')
21
21
 
22
- element.parentNode.insertBefore(box, element)
23
- element.remove()
24
- })
22
+ element.parentNode.insertBefore(box, element)
23
+ element.remove()
24
+ })
25
25
 
26
- $dom.each(p + ' .md img:not(.emoji):not(.vemoji)', (element) => {
27
- const $image = q(element)
28
- const imageLink = $image.attr('data-src') || $image.attr('src') // 替换
29
- const $imageWrapLink = $image.wrap('<a class="fancybox" href="' + imageLink + '" itemscope itemtype="https://schema.org/ImageObject" itemprop="url"></a>').parent('a')
30
- let info; let captionClass = 'image-info'
31
- if (!$image.is('a img')) {
32
- $image.data('safe-src', imageLink)
33
- if (!$image.is('.gallery img')) {
34
- $imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default')
35
- } else {
36
- captionClass = 'jg-caption'
37
- }
38
- }
39
- if ((info = element.getAttribute('title'))) {
40
- $imageWrapLink.attr('data-caption', info)
41
- const para = document.createElement('span')
42
- const txt = document.createTextNode(info)
43
- para.appendChild(txt)
44
- para.addClass(captionClass)
45
- insertAfter(element, para)
46
- }
47
- })
26
+ $dom.each(p + ' .md img:not(.emoji):not(.vemoji)', (element) => {
27
+ const $image = q(element)
28
+ const imageLink = $image.attr('data-src') || $image.attr('src') // 替换
29
+ const $imageWrapLink = $image.wrap('<a class="fancybox" href="' + imageLink + '" itemscope itemtype="https://schema.org/ImageObject" itemprop="url"></a>').parent('a')
30
+ let info; let captionClass = 'image-info'
31
+ if (!$image.is('a img')) {
32
+ $image.data('safe-src', imageLink)
33
+ if (!$image.is('.gallery img')) {
34
+ $imageWrapLink.attr('data-fancybox', 'default').attr('rel', 'default')
35
+ } else {
36
+ captionClass = 'jg-caption'
37
+ }
38
+ }
39
+ if ((info = element.getAttribute('title'))) {
40
+ $imageWrapLink.attr('data-caption', info)
41
+ const para = document.createElement('span')
42
+ const txt = document.createTextNode(info)
43
+ para.appendChild(txt)
44
+ para.addClass(captionClass)
45
+ insertAfter(element, para)
46
+ }
47
+ })
48
48
 
49
- $dom.each(p + ' div.gallery', (el, i) => {
50
- // @ts-ignore
51
- q(el).justifiedGallery({
52
- rowHeight: q(el).data('height') || 120,
53
- rel: 'gallery-' + i
54
- }).on('jg.complete', function () {
55
- q(this).find('a').each((k, ele) => {
56
- ele.setAttribute('data-fancybox', 'gallery-' + i)
49
+ $dom.each(p + ' div.gallery', (el, i) => {
50
+ // @ts-ignore
51
+ q(el).justifiedGallery({
52
+ rowHeight: q(el).data('height') || 120,
53
+ rel: 'gallery-' + i
54
+ }).on('jg.complete', function () {
55
+ q(this).find('a').each((k, ele) => {
56
+ ele.setAttribute('data-fancybox', 'gallery-' + i)
57
+ })
58
+ })
57
59
  })
58
- })
59
- })
60
60
 
61
- q.fancybox.defaults.hash = false
62
- q(p + ' .fancybox').fancybox({
63
- loop: true,
64
- // @ts-ignore
65
- helpers: {
66
- overlay: {
67
- locked: false
68
- }
69
- }
61
+ q.fancybox.defaults.hash = false
62
+ q(p + ' .fancybox').fancybox({
63
+ loop: true,
64
+ // @ts-ignore
65
+ helpers: {
66
+ overlay: {
67
+ locked: false
68
+ }
69
+ }
70
+ })
71
+ // @ts-ignore
72
+ }, window.jQuery)
70
73
  })
71
- // @ts-ignore
72
- }, window.jQuery)
74
+ })
73
75
  }
74
76
  }
package/CONTRIBUTING.md DELETED
@@ -1,58 +0,0 @@
1
- # Contributing for hexo-theme-shokaX
2
-
3
- ---
4
- > 请在贡献前仔细阅读本文档
5
-
6
- 目录:
7
- 1. [代码贡献指南](#代码贡献指南)
8
- 2. [翻译贡献指南](#翻译贡献指南)
9
- 3. [最后需要注意的事项](#最后需要注意的事项)
10
-
11
- # 代码贡献指南
12
- ## 前言
13
- 在提交代码之前,我们默认以下几点:
14
- 1. 您同意我们在未来进行授权许可更改时包含您所贡献的代码
15
- 2. 您有对于 shokaX 所使用的相关技术和 github PR 及 actions 的基础了解
16
-
17
- 有关提交的说明:
18
- 1. 您在提交时的`commit message`应描述其改动
19
- 2. 如果您提交的代码中包括图片资源,建议使用`webp`或`avif`格式
20
- 3. 条件允许的情况下代码应当附有注释以便维护
21
-
22
- 有关审查(Review)的说明:
23
- 1. 您在 PR 时应打开允许维护者修改 PR,以便我们进行修改
24
- 2. 您愿意接受长时间的等待(一般不超过15天)
25
- 3. 您能够接受因代码质量等问题而提出的疑问,并愿意讨论是否接受更改
26
-
27
- 有关issues的说明:
28
- 1. 如果您愿意开发某 issues 的提议功能或修复 bug,建议在对应 issue 下评论说明一下,避免闭门造车和重复造轮子的惨剧
29
- 2. 您应该在对应 PR 提交时绑定对应 issue,以便进行统计
30
-
31
- ## Github PR
32
- 此处为在使用 Github PR 提交时应注意的事:
33
- - 默认你对 Git、GitHub 已经有了一定的了解,并且懂得使用 PR(此方面问题可以去讨论区发起 Q&A)
34
- - 请提交 PR 至 main 分支
35
- - PR 标题应简要明了地描述改动
36
- - 未完工的代码仍可提交 PR,可以先设置为 Draft
37
- - 善用相关词语填写 PR 信息或 Commit 信息,如提交、更新/修改、删除
38
- - 请确保您所提交的代码可以正常运行
39
- - 如果 PR 中删除了没有替代的代码,请注明删除原因
40
-
41
- # 翻译贡献指南
42
- 在提交代码之前,我们默认以下几点:
43
- 1. 您同意我们在未来进行授权许可更改时包含您所贡献的翻译
44
- 2. 您有对于 shokaX 的翻译原文和 github PR 及 actions 的基础了解
45
-
46
- 翻译排版参考[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines/blob/master/README.zh-Hans.md) \
47
- **截止本指南写就时,shokaX 存在大量不符合此指北的翻译,我们欢迎提交 PR 修正这些错误**
48
-
49
- 有关审查(Review)的说明:
50
- 1. 您在 PR 时应打开允许维护者修改 PR,以便我们进行修改
51
- 2. 您愿意接受长时间的等待(一般不超过15天)
52
- 3. 您能够接受因翻译质量等问题而提出的疑问,并愿意讨论是否接受更改
53
-
54
- PR提交参考代码贡献指南即可
55
-
56
- # 最后需要注意的事项
57
- 有问题可以前往讨论区进行讨论,其他渠道正在建设 \
58
- **本项目的每个贡献者都是理应感谢的人。**