hexo-theme-shokax 0.4.19 → 0.4.21

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.
@@ -94,6 +94,8 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
94
94
  else
95
95
  - audioValue = "undefined"
96
96
 
97
+ - var ccIcon = '<i class="ic i-creative-commons"></i>'
98
+ - var ccText = theme.creative_commons.license.toUpperCase()
97
99
  script(data-config type="text/javascript").
98
100
  var LOCAL = {
99
101
  ispost: !{is_post()},
@@ -107,6 +109,8 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
107
109
  empty: "!{__('search.empty')}",
108
110
  stats: "!{__('search.stats')}"
109
111
  },
112
+ nocopy: "!{!!page.nocopy}",
113
+ copyright: `!{page.copyright !== false ? (page.nocopy === true ? __("tips.nocopy") : __("tips.copyright", ccIcon + ccText)) : undefined}`,
110
114
  copy_tex: #{!!page.math},
111
115
  katex: #{!!page.math},
112
116
  mermaid: #{!!page.mermaid},
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
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.15.4",
9
+ "packageManager": "pnpm@10.4.1",
10
10
  "scripts": {
11
11
  "test": "tsc --build --verbose",
12
12
  "build": "node ./toolbox/compiler.mjs"
@@ -16,21 +16,22 @@
16
16
  "@types/jquery": "^3.5.32",
17
17
  "@types/js-yaml": "^4.0.9",
18
18
  "@types/katex": "^0.16.7",
19
- "@types/node": "^22.10.10",
19
+ "@types/node": "^22.13.4",
20
20
  "@types/quicklink": "^2.3.4",
21
- "@typescript-eslint/eslint-plugin": "^8.21.0",
22
- "@typescript-eslint/parser": "^8.21.0",
23
- "eslint": "^9.19.0",
21
+ "@typescript-eslint/eslint-plugin": "^8.24.1",
22
+ "@typescript-eslint/parser": "^8.24.1",
23
+ "eslint": "^9.20.1",
24
24
  "eslint-config-standard": "~17",
25
25
  "eslint-plugin-vue": "^9.32.0",
26
26
  "glob": "^11.0.1",
27
27
  "typescript": "^5.7.3"
28
28
  },
29
29
  "dependencies": {
30
- "@algolia/client-search": "^5.20.0",
31
- "@waline/client": "^3.5.1",
32
- "algoliasearch": "5.20.0",
33
- "esbuild": "^0.24.2",
30
+ "@algolia/client-search": "^5.20.3",
31
+ "@waline/client": "^3.5.2",
32
+ "algoliasearch": "5.20.3",
33
+ "dompurify": "^3.2.4",
34
+ "esbuild": "^0.25.0",
34
35
  "hexo": "^7.3.0",
35
36
  "hexo-algoliasearch": "^2.0.1",
36
37
  "hexo-feed": "^1.1.2",
@@ -38,12 +39,12 @@
38
39
  "hexo-pagination": "^4.0.0",
39
40
  "hexo-renderer-pug": "^3.0.0",
40
41
  "hexo-util": "^3.3.0",
41
- "instantsearch.js": "^4.77.1",
42
+ "instantsearch.js": "^4.77.3",
42
43
  "js-yaml": "^4.1.0",
43
44
  "katex": "^0.16.21",
44
- "mouse-firework": "^0.0.6",
45
+ "mouse-firework": "^0.1.0",
45
46
  "quicklink": "^2.3.0",
46
- "theme-shokax-anime": "^0.0.7",
47
+ "theme-shokax-anime": "^0.0.8",
47
48
  "theme-shokax-pjax": "^0.0.3",
48
49
  "twikoo": "^1.6.41",
49
50
  "unlazy": "^0.12.1"
@@ -63,6 +64,10 @@
63
64
  "object.fromentries": "npm:@nolyfill/object.fromentries@latest",
64
65
  "object.groupby": "npm:@nolyfill/object.groupby@latest",
65
66
  "object.values": "npm:@nolyfill/object.values@latest"
66
- }
67
+ },
68
+ "onlyBuiltDependencies": [
69
+ "esbuild",
70
+ "hexo-util"
71
+ ]
67
72
  }
68
73
  }
@@ -147,7 +147,9 @@ export const sidebarTOC = () => {
147
147
 
148
148
  sections = sections.map((element, index) => {
149
149
  const link = element.querySelector('a.toc-link')
150
- const anchor = document.getElementById(decodeURI(link.getAttribute('href').replace('#', '')))
150
+ const linkHref = link.getAttribute('href')
151
+ if (!linkHref) return null
152
+ const anchor = document.getElementById(decodeURI(linkHref.replace('#', '')))
151
153
  if (!anchor) return null
152
154
  const alink = anchor.querySelector('a.anchor')
153
155
 
@@ -1,6 +1,7 @@
1
1
  import { $dom } from '../library/dom'
2
2
  import { vendorCss, vendorJs } from '../library/loadFile'
3
3
  import { insertAfter } from '../library/proto'
4
+ import DOMPurify from 'dompurify';
4
5
 
5
6
  // TODO 使用PhotoSwipe替换Fancybox
6
7
  export const postFancybox = (p:string) => {
@@ -20,7 +21,7 @@ export const postFancybox = (p:string) => {
20
21
 
21
22
  $dom.each(p + ' .md img:not(.emoji):not(.vemoji)', (element) => {
22
23
  const $image = $(element)
23
- const imageLink = $image.attr('data-src') || $image.attr('src') // 替换
24
+ const imageLink = DOMPurify.sanitize($image.attr('data-src') || $image.attr('src')) // 替换
24
25
  const $imageWrapLink = $image.wrap('<a class="fancybox" href="' + imageLink + '" itemscope itemtype="https://schema.org/ImageObject" itemprop="url"></a>').parent('a')
25
26
  let info; let captionClass = 'image-info'
26
27
  if (!$image.is('a img')) {