hexo-theme-shokax 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 公告
2
+ [关于ShokaX markdown扩展特性的讨论](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/177) \
3
+ [关于删除部分评论系统的讨论](https://github.com/theme-shoka-x/hexo-theme-shokaX/discussions/175)
1
4
  # hexo-theme-shokaX
2
5
  ![LICENSE]( https://img.shields.io/github/license/theme-shoka-x/hexo-theme-shokaX)
3
6
  ![stars](https://img.shields.io/github/stars/theme-shoka-x/hexo-theme-shokaX)
@@ -83,4 +86,4 @@ AGPL许可证主要目的是限制修改后的分发行为,避免未经许可
83
86
  [<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport)
84
87
 
85
88
  ## 其他信息
86
- ![Star history chart](https://api.star-history.com/svg?repos=theme-shoka-x/hexo-theme-shokaX&type=Date)
89
+ ![Star history chart](https://api.star-history.com/svg?repos=theme-shoka-x/hexo-theme-shokaX&type=Date)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
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",
@@ -18,27 +18,28 @@
18
18
  "@types/js-yaml": "^4.0.9",
19
19
  "@types/lozad": "^1.16.4",
20
20
  "@types/mocha": "^10.0.6",
21
- "@types/node": "^20.10.0",
22
- "@typescript-eslint/eslint-plugin": "^6.12.0",
23
- "@typescript-eslint/parser": "^6.12.0",
21
+ "@types/node": "^20.10.2",
22
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
23
+ "@typescript-eslint/parser": "^6.13.1",
24
24
  "chai": "^4.3.10",
25
- "eslint": "^8.54.0",
25
+ "eslint": "^8.55.0",
26
26
  "eslint-config-standard": "~17",
27
27
  "eslint-plugin-chai-friendly": "^0.7.2",
28
28
  "eslint-plugin-import": "^2.29.0",
29
29
  "eslint-plugin-n": "^16.3.1",
30
30
  "eslint-plugin-promise": "^6.1.1",
31
- "eslint-plugin-vue": "^9.18.1",
31
+ "eslint-plugin-vue": "^9.19.2",
32
32
  "hexo-fs": "^4.1.1",
33
33
  "hexo-util": "^3.1.0",
34
34
  "instantsearch.js": "^4.60.0",
35
+ "jsdom": "^23.0.1",
35
36
  "mocha": "^10.2.0",
36
37
  "typescript": "^5.3.2",
37
- "vue": "^3.3.9",
38
- "jsdom": "^23.0.0"
38
+ "vue": "^3.3.9"
39
39
  },
40
40
  "dependencies": {
41
- "esbuild": "^0.19.7",
41
+ "esbuild": "^0.19.8",
42
+ "hexo": "^7.0.0",
42
43
  "js-yaml": "^4.1.0",
43
44
  "lozad": "^1.16.0",
44
45
  "theme-shokax-anime": "^0.0.4",
@@ -30,7 +30,7 @@ hexo.extend.filter.register('before_generate', () => {
30
30
  hexo.theme.config.style[style] = path_1.default.resolve(hexo.base_dir, custom_file);
31
31
  }
32
32
  }
33
- if (data.images && data.images.length >= 6) {
33
+ if (data.images && data.images.length > 0) {
34
34
  hexo.theme.config.image_list = data.images;
35
35
  }
36
36
  else {
@@ -1,16 +1,17 @@
1
- 'use strict';
2
- hexo.extend.generator.register('pages', function (locals) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ hexo.extend.generator.register('pages', function () {
3
4
  const config = hexo.config;
4
5
  return [
5
6
  {
6
7
  path: config.category_dir + '/index.html',
7
8
  data: { type: 'categories' },
8
- layout: ['page']
9
+ layout: 'page'
9
10
  },
10
11
  {
11
12
  path: config.tag_dir + '/index.html',
12
13
  data: { type: 'tags' },
13
- layout: ['page']
14
+ layout: 'page'
14
15
  }
15
16
  ];
16
17
  });
@@ -27,8 +27,11 @@ const randomBG = function (count = 1, image_server = null, image_list = []) {
27
27
  }
28
28
  };
29
29
  if (count && count > 1) {
30
- const shuffled = image_list.slice(0);
31
- i = image_list.length;
30
+ let shuffled = image_list.slice(0);
31
+ while (shuffled.length <= 6) {
32
+ shuffled = shuffled.concat(image_list.slice(0));
33
+ }
34
+ i = shuffled.length;
32
35
  const min = i - count;
33
36
  let temp;
34
37
  let index;
@@ -1,6 +1,4 @@
1
1
  'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("hexo-fs");
4
2
  const prepareQuery = (categories, parent) => {
5
3
  const query = {
6
4
  parent: undefined
@@ -47,32 +45,6 @@ hexo.extend.helper.register('_list_categories', function (depth = 0) {
47
45
  };
48
46
  return hierarchicalList(0);
49
47
  });
50
- hexo.extend.helper.register('_categories', function () {
51
- const categories = this.site.categories;
52
- if (!categories || !categories.length)
53
- return '';
54
- const pangu = {
55
- spacing: data => {
56
- return data;
57
- }
58
- };
59
- const result = {};
60
- categories.forEach((cat, i) => {
61
- const child = prepareQuery(categories, cat._id);
62
- const cover = 'source/_posts' + cat.path.replace(this.config.category_dir, '') + 'cover.jpg';
63
- if (fs.existsSync(cover)) {
64
- const className = cat.slug.split('/');
65
- className.pop();
66
- cat.class = className.join(' ');
67
- cat.name = pangu.spacing(cat.name);
68
- if (child.length !== 0) {
69
- cat.child = child;
70
- }
71
- result[cat._id] = cat;
72
- }
73
- });
74
- return result;
75
- });
76
48
  hexo.extend.helper.register('_category_prev', function (name) {
77
49
  const categories = this.site.categories;
78
50
  if (!categories || !categories.length)
@@ -1,6 +1,6 @@
1
1
  let findProblem = false;
2
2
  hexo.on('generateBefore', function () {
3
- if (hexo.config.highlight.enable || hexo.config.prismjs.enable) {
3
+ if (hexo.config.syntax_highlighter) {
4
4
  findProblem = true;
5
5
  hexo.log.error('[SXEC 101] Highlight.js or Prismjs enabled. The code block will render incomplete');
6
6
  }
@@ -1,4 +1,4 @@
1
- 'use strict';
1
+ "use strict";
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
@@ -14,47 +14,29 @@ function linkGrid(args, content) {
14
14
  if (args[0]) {
15
15
  const filepath = node_path_1.default.join(hexo.source_dir, args[0]);
16
16
  if (node_fs_1.default.existsSync(filepath)) {
17
- content = node_fs_1.default.readFileSync(filepath);
17
+ content = node_fs_1.default.readFileSync(filepath, { encoding: 'utf-8' });
18
18
  }
19
19
  }
20
20
  if (!content) {
21
21
  return;
22
22
  }
23
- const siteHost = new URL(hexo.config.url).hostname || hexo.config.url;
24
23
  const list = js_yaml_1.default.load(content);
25
24
  let result = '';
26
25
  list.forEach((item) => {
27
26
  if (!item.url || !item.site) {
28
27
  return;
29
28
  }
30
- let urlparam = {
31
- protocol: undefined,
32
- hostname: undefined
33
- };
34
- if (item.url) {
35
- urlparam = new URL(item.url, hexo.config.url);
36
- }
37
29
  let item_image = item.image || theme.assets + '/404.png';
38
30
  if (!item_image.startsWith('//') && !item_image.startsWith('http')) {
39
31
  item_image = theme.statics + item_image;
40
32
  }
41
33
  item.color = item.color ? ` style="--block-color:${item.color};"` : '';
42
34
  result += `<div class="item" title="${item.owner || item.site}"${item.color}>`;
43
- if (urlparam.protocol && urlparam.hostname !== siteHost) {
44
- const durl = Buffer.from(item.url).toString('base64');
45
- result += `<span class="image" data-url="${durl}" data-background-image="${item_image}"></span>
46
- <div class="info">
47
- <span class="title" data-url="${durl}">${item.site}</span>
48
- <p class="desc">${item.desc || item.url}</p>
49
- </div></div>`;
50
- }
51
- else {
52
- result += `<a href="${item.url}" class="image" data-background-image="${item_image}"></a>
53
- <div class="info">
54
- <a href="${item.url}" class="title">${item.site}</a>
55
- <p class="desc">${item.desc || item.url}</p>
56
- </div></div>`;
57
- }
35
+ result += `<a href="${item.url}" class="image" data-background-image="${item_image}"></a>
36
+ <div class="info">
37
+ <a href="${item.url}" class="title">${item.site}</a>
38
+ <p class="desc">${item.desc || item.url}</p>
39
+ </div></div>`;
58
40
  });
59
41
  return `<div class="links">${result}</div>`;
60
42
  }