hexo-theme-shokax 0.4.2 → 0.4.3

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
@@ -234,16 +234,17 @@ summary:
234
234
  # Value before `||` delimiter is the target permalink,
235
235
  # secend value is the name of Font icon.
236
236
  social:
237
- github: https://github.com/name || github || "#191717"
237
+ github: https://github.com/yourname || github || "#191717"
238
+ #gitee: https://gitee.com/yourname || gitee || "#e60026"
238
239
  #google: https://plus.google.com/yourname || google
239
240
  #twitter: https://twitter.com/yourname || twitter || "#00aff0"
240
241
  #zhihu: https://www.zhihu.com/people/yourname || zhihu || "#1e88e5"
241
242
  #music: https://music.163.com/#/user/home?id=yourid || cloud-music || "#e60026"
242
243
  #weibo: https://weibo.com/yourname || weibo || "#ea716e"
243
244
  #about: https://about.me/yourname || address-card || "#3b5998"
244
- # email: mailto:foo@xxx.com || envelope || "#55acd5"
245
+ #email: mailto:foo@xxx.com || envelope || "#55acd5"
245
246
  #facebook: https://www.facebook.com/yourname || facebook
246
- # stackoverflow: https://stackoverflow.com/ || stack-overflow
247
+ #stackoverflow: https://stackoverflow.com/ || stack-overflow
247
248
  #youtube: https://youtube.com/yourname || youtube
248
249
  #instagram: https://instagram.com/yourname || instagram
249
250
  #skype: skype:yourname?call|chat || skype
@@ -370,13 +371,13 @@ vendors:
370
371
  unpkg: https://unpkg.com
371
372
  js:
372
373
  pace: bytedance|pace/1.2.4/pace.min.js
373
- # pjax: npm_webcache|theme-shokax-pjax@0.0.3/pjax.shokax.min.js
374
- # anime: npm_webcache|theme-shokax-anime@0.0.6/anime.shokax.min.js
375
- # lozad: npm_webcache|lozad@1.16.0/dist/lozad.min.js
376
- # algolia: bytedance|algoliasearch/4.12.1/algoliasearch-lite.umd.min.js
377
- # instantsearch: bytedance|instantsearch.js/4.39.0/instantsearch.production.min.js
378
- # quicklink: npm_webcache|quicklink@2.3.0/dist/quicklink.umd.js
379
- # mouse_firework: npm_webcache|mouse-firework@0.0.4/dist/index.umd.js
374
+ # pjax: npm_webcache|theme-shokax-pjax@0.0.3/pjax.shokax.min.js
375
+ # anime: npm_webcache|theme-shokax-anime@0.0.6/anime.shokax.min.js
376
+ # lozad: npm_webcache|lozad@1.16.0/dist/lozad.min.js
377
+ # algolia: bytedance|algoliasearch/4.12.1/algoliasearch-lite.umd.min.js
378
+ # instantsearch: bytedance|instantsearch.js/4.39.0/instantsearch.production.min.js
379
+ # quicklink: npm_webcache|quicklink@2.3.0/dist/quicklink.umd.js
380
+ # mouse_firework: npm_webcache|mouse-firework@0.0.4/dist/index.umd.js
380
381
  async_js:
381
382
  fancybox: 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
382
383
  copy_tex: npm_webcache|katex@0.16.7/dist/contrib/copy-tex.min.js
@@ -384,4 +385,4 @@ vendors:
384
385
  katex: npm_webcache|katex@0.16.7/dist/katex.min.css
385
386
  comment: css/comment.css
386
387
  fancybox: npm_webcache|@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
387
- justifiedGallery: npm_webcache|justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
388
+ justifiedGallery: npm_webcache|justifiedGallery@3.8.1/dist/css/justifiedGallery.min.css
@@ -0,0 +1,55 @@
1
+ export default [
2
+ {
3
+ files: ['*.ts', '*.tsx', '*.vue'],
4
+ languageOptions: {
5
+ parser: '@typescript-eslint/parser',
6
+ parserOptions: {
7
+ ecmaVersion: 2022
8
+ }
9
+ },
10
+ plugins: {
11
+ '@typescript-eslint': await import('@typescript-eslint/eslint-plugin'),
12
+ 'vue': await import('eslint-plugin-vue')
13
+ },
14
+ rules: {
15
+ camelcase: 'off',
16
+ 'n/no-callback-literal': 'off',
17
+ '@typescript-eslint/ban-types': 'off',
18
+ '@typescript-eslint/ban-ts-comment': 'off',
19
+ '@typescript-eslint/no-var-requires': 'off',
20
+ '@typescript-eslint/no-unused-vars': 'off',
21
+ 'prefer-const': 'off'
22
+ }
23
+ },
24
+ {
25
+ files: ['*.js', '*.jsx'],
26
+ languageOptions: {
27
+ ecmaVersion: 2022
28
+ },
29
+ env: {
30
+ browser: true,
31
+ commonjs: true,
32
+ es6: true,
33
+ node: true
34
+ },
35
+ extends: [
36
+ 'standard'
37
+ ],
38
+ rules: {
39
+ camelcase: 'off',
40
+ 'n/no-callback-literal': 'off',
41
+ 'prefer-const': 'off'
42
+ }
43
+ },
44
+ {
45
+ files: ['*.vue'],
46
+ languageOptions: {
47
+ parserOptions: {
48
+ ecmaVersion: 2022
49
+ }
50
+ },
51
+ extends: [
52
+ 'plugin:vue/vue3-recommended'
53
+ ]
54
+ }
55
+ ];
@@ -4,7 +4,8 @@ div(class="meta")
4
4
  span(class="icon")
5
5
  i(class="ic i-eye")
6
6
  span 此文章已被阅读次数:
7
- span(id="twikoo_visitors" class="waline-pageview-count" data-path=post.path) 正在加载...
7
+ - var prefixedPath = post.path.startsWith('/') ? post.path : '/' + post.path
8
+ span(id="twikoo_visitors" class="waline-pageview-count" data-path=prefixedPath) 正在加载...
8
9
  span(class="item")
9
10
  span(class="icon")
10
11
  i(class="ic i-calendar-check")
package/package.json CHANGED
@@ -1,50 +1,50 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
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@8.14.1",
9
+ "packageManager": "pnpm@9.4.0",
10
10
  "scripts": {
11
11
  "test": "tsc --build --verbose",
12
12
  "build": "cd ./scripts && tsc --build --verbose"
13
13
  },
14
14
  "devDependencies": {
15
- "@types/fancybox": "^3.5.6",
16
- "@types/jquery": "^3.5.29",
15
+ "@types/fancybox": "^3.5.7",
16
+ "@types/jquery": "^3.5.30",
17
17
  "@types/js-yaml": "^4.0.9",
18
- "@types/node": "^20.11.10",
18
+ "@types/node": "^20.14.8",
19
19
  "@types/quicklink": "^2.3.4",
20
- "@typescript-eslint/eslint-plugin": "^6.20.0",
21
- "@typescript-eslint/parser": "^6.20.0",
22
- "eslint": "^8.56.0",
20
+ "@typescript-eslint/eslint-plugin": "^7.13.1",
21
+ "@typescript-eslint/parser": "^7.13.1",
22
+ "eslint": "^9.5.0",
23
23
  "eslint-config-standard": "~17",
24
24
  "eslint-plugin-import": "^2.29.1",
25
- "eslint-plugin-n": "^16.6.2",
26
- "eslint-plugin-promise": "^6.1.1",
27
- "eslint-plugin-vue": "^9.20.1",
28
- "typescript": "^5.3.3"
25
+ "eslint-plugin-n": "^17.9.0",
26
+ "eslint-plugin-promise": "^6.2.0",
27
+ "eslint-plugin-vue": "^9.26.0",
28
+ "typescript": "^5.5.2"
29
29
  },
30
30
  "dependencies": {
31
- "@waline/client": "^3.0.1",
32
- "vue": "^3.4.15",
33
- "@algolia/client-search": "^4.22.1",
34
- "algoliasearch": "4.22.1",
35
- "esbuild": "^0.20.0",
36
- "hexo": "7.0.0",
37
- "hexo-fs": "^4.1.1",
31
+ "@waline/client": "^3.2.2",
32
+ "vue": "^3.4.30",
33
+ "@algolia/client-search": "^4.23.3",
34
+ "algoliasearch": "4.23.3",
35
+ "esbuild": "^0.21.5",
36
+ "hexo": "7.2.0",
37
+ "hexo-fs": "^4.1.3",
38
38
  "hexo-pagination": "^3.0.0",
39
- "hexo-util": "^3.2.0",
40
- "instantsearch.js": "^4.64.2",
39
+ "hexo-util": "^3.3.0",
40
+ "instantsearch.js": "^4.72.1",
41
41
  "js-yaml": "^4.1.0",
42
42
  "mouse-firework": "^0.0.5",
43
43
  "quicklink": "^2.3.0",
44
44
  "theme-shokax-anime": "^0.0.6",
45
45
  "theme-shokax-pjax": "^0.0.3",
46
- "twikoo": "^1.6.31",
47
- "unlazy": "^0.10.4",
46
+ "twikoo": "^1.6.36",
47
+ "unlazy": "^0.11.3",
48
48
  "hexo-lightning-minify": "latest",
49
49
  "hexo-algoliasearch": "latest",
50
50
  "hexo-feed": "latest",
@@ -53,5 +53,18 @@
53
53
  "engines": {
54
54
  "node": ">=18.0.0"
55
55
  },
56
- "engineStrict": true
56
+ "engineStrict": true,
57
+ "pnpm": {
58
+ "overrides": {
59
+ "array-includes": "npm:@nolyfill/array-includes@latest",
60
+ "array.prototype.findlastindex": "npm:@nolyfill/array.prototype.findlastindex@latest",
61
+ "array.prototype.flat": "npm:@nolyfill/array.prototype.flat@latest",
62
+ "array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@latest",
63
+ "hasown": "npm:@nolyfill/hasown@latest",
64
+ "is-regex": "npm:@nolyfill/is-regex@latest",
65
+ "object.fromentries": "npm:@nolyfill/object.fromentries@latest",
66
+ "object.groupby": "npm:@nolyfill/object.groupby@latest",
67
+ "object.values": "npm:@nolyfill/object.values@latest"
68
+ }
69
+ }
57
70
  }
@@ -39,7 +39,10 @@ hexo.extend.filter.register('before_generate', () => {
39
39
  else {
40
40
  hexo.theme.config.image_list = js_yaml_1.default.load(node_fs_1.default.readFileSync(path_1.default.join(__dirname, '../../_images.yml'), { encoding: 'utf-8' }));
41
41
  }
42
- if (node_fs_1.default.existsSync(path_1.default.join(__dirname, '../../_images_index.yml'))) {
42
+ if (data.images_index && data.images_index.length > 0) {
43
+ hexo.theme.config.index_images = data.images_index;
44
+ }
45
+ else if (node_fs_1.default.existsSync(path_1.default.join(__dirname, '../../_images_index.yml'))) {
43
46
  hexo.theme.config.index_images = js_yaml_1.default.load(node_fs_1.default.readFileSync(path_1.default.join(__dirname, '../../_images_index.yml'), { encoding: 'utf-8' }));
44
47
  }
45
48
  else {
@@ -47,10 +47,10 @@ hexo.on('generateBefore', () => {
47
47
  });
48
48
  hexo.on('generateAfter', () => {
49
49
  // 检查版本更新
50
- fetch('https://registry.npmmirror.com/hexo-theme-shokax').then((res) => {
50
+ fetch('https://api.shokax.top/version/hexo').then((res) => {
51
51
  res.json().then((resp) => {
52
52
  try {
53
- const latest = resp['dist-tags'].latest;
53
+ const latest = resp['version'];
54
54
  const current = package_json_1.version.split('.');
55
55
  let isOutdated = false;
56
56
  for (let i = 0; i < Math.max(latest.length, current.length); i++) {
package/scripts/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getVendorLink = void 0;
3
+ exports.getVendorLink = getVendorLink;
4
4
  function getVendorLink(hexo, source) {
5
5
  const VendorsCfg = hexo.theme.config.vendors;
6
6
  const tagIdx = source.indexOf('|');
@@ -11,4 +11,3 @@ function getVendorLink(hexo, source) {
11
11
  return source;
12
12
  }
13
13
  }
14
- exports.getVendorLink = getVendorLink;
@@ -267,11 +267,11 @@ code,
267
267
  }
268
268
 
269
269
  // For diff highlight
270
- .deletion {
270
+ .deletion, .deleted {
271
271
  background: var(--color-pink-light);
272
272
  }
273
273
 
274
- .addition {
274
+ .addition, .inserted {
275
275
  background: var(--color-cyan-light);
276
276
  }
277
277
 
@@ -20,6 +20,7 @@
20
20
  padding: 1.25rem 2.5rem;
21
21
  background-size: cover;
22
22
  position: relative;
23
+ transform: scale(1);
23
24
 
24
25
  &::before {
25
26
  content: "";
@@ -1,4 +1,4 @@
1
- import twikoo from 'twikoo'
1
+ import * as twikoo from 'twikoo'
2
2
  import { CONFIG } from '../globals/globalVars'
3
3
  import { $dom } from '../library/dom'
4
4
 
@@ -72,35 +72,33 @@ export const siteRefresh = (reload) => {
72
72
  sideBarTab()
73
73
  sidebarTOC()
74
74
 
75
- if (LOCAL.ispost) {
76
- import('../page/post').then(({ postBeauty }) => {
77
- postBeauty()
78
- })
75
+ import('../page/post').then(({ postBeauty }) => {
76
+ postBeauty()
77
+ })
79
78
 
80
- const comment = new IntersectionObserver((entries) => {
81
- entries.forEach((entry) => {
82
- if (entry.isIntersecting) {
83
- if (__shokax_waline__) {
84
- import('../components/comments').then(({ walinePageview, walineComment }) => {
85
- walinePageview()
86
- walineComment()
87
- })
88
- }
89
- if (__shokax_twikoo__) {
90
- import('../components/tcomments').then(({ twikooComment }) => {
91
- twikooComment()
92
- })
93
- }
94
- comment.disconnect()
79
+ const comment = new IntersectionObserver((entries) => {
80
+ entries.forEach((entry) => {
81
+ if (entry.isIntersecting) {
82
+ if (__shokax_waline__) {
83
+ import('../components/comments').then(({ walinePageview, walineComment }) => {
84
+ walinePageview()
85
+ walineComment()
86
+ })
95
87
  }
96
- })
97
- }, {
98
- root: null,
99
- threshold: 0.2
88
+ if (__shokax_twikoo__) {
89
+ import('../components/tcomments').then(({ twikooComment }) => {
90
+ twikooComment()
91
+ })
92
+ }
93
+ comment.disconnect()
94
+ }
100
95
  })
96
+ }, {
97
+ root: null,
98
+ threshold: 0.2
99
+ })
101
100
 
102
- comment.observe($dom('#copyright'))
103
- }
101
+ comment.observe($dom('#copyright'))
104
102
 
105
103
  lazyLoad()
106
104
 
@@ -55,6 +55,7 @@ const siteInit = () => {
55
55
  })
56
56
 
57
57
  // Handle and trigger popup window
58
+ // search 只有一个,不需要 each
58
59
  $dom.each('.search', (element) => {
59
60
  element.addEventListener('click', () => {
60
61
  document.body.style.overflow = 'hidden'