hexo-theme-shokax 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -80,7 +80,10 @@ AGPL许可证主要目的是限制修改后的分发行为,避免未经许可
80
80
  | hexo-theme-shoka | amehime | 本项目的父主题 |
81
81
 
82
82
  ## 开发者们
83
- [![](https://contributors-img.web.app/image?repo=theme-shoka-x/hexo-theme-shokaX)](https://github.com/theme-shoka-x/hexo-theme-shokaX/graphs/contributors)
83
+ Hexo 主题: \
84
+ [![](https://contributors-img.web.app/image?repo=theme-shoka-x/hexo-theme-shokaX)](https://github.com/theme-shoka-x/hexo-theme-shokaX/graphs/contributors) \
85
+ ShokaX 文档: \
86
+ [![](https://contributors-img.web.app/image?repo=theme-shoka-x/shokaX-docs)](https://github.com/theme-shoka-x/shokaX-docs/graphs/contributors) \
84
87
 
85
88
  ## 特别鸣谢
86
89
  [<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="25%">](https://jb.gg/OpenSourceSupport)
package/_config.yml CHANGED
@@ -183,29 +183,6 @@ waline:
183
183
  pageSize: 10 # 每页评论条数
184
184
  pageview: false # 是否开启浏览量统计,可独立开启
185
185
 
186
- # https://github.com/gitalk/gitalk/blob/master/readme-cn.md
187
- gitalk:
188
- clientID:
189
- clientSecret:
190
- repo:
191
- owner:
192
- admin:
193
- proxy: # 选填
194
-
195
- # https://giscus.app/zh-CN
196
- giscus:
197
- repo:
198
- repoId:
199
- category:
200
- categoryId:
201
- mapping:
202
- strict:
203
- reactionsEnabled:
204
- emitMetadata:
205
- inputPosition:
206
- commentTheme:
207
- lang:
208
-
209
186
  summary:
210
187
  enable: false
211
188
  introduce: "我是基于ChatGPT-turbo-3.5实现的AI助手,在此网站上负责整理和概括文章" # AI自我介绍
@@ -1,6 +1,6 @@
1
1
  mixin CommentRender()
2
2
  != shokax_inject('comment')
3
- - var tk = theme?.twikoo?.enable,wl = theme?.waline?.enable,gt=theme?.gitalk?.enable,gs=theme?.giscus?.enable
3
+ - var tk = theme?.twikoo?.enable,wl = theme?.waline?.enable
4
4
  if page.comment !== false && !theme.experiments.disableThemeComment
5
5
  if tk
6
6
  div(class="wrap" id="tcomments")
@@ -37,38 +37,5 @@ mixin CommentRender()
37
37
  dark: 'html[data-theme="dark"]'
38
38
  });
39
39
  }, 1000)
40
- else if gt
41
- div(class="wrap" id="gtcomments")
42
- script(type="text/javascript" data-pjax).
43
- const gproxy = theme.gitalk.proxy || undefined
44
- const gitalk = new Gitalk({
45
- clientID: '#{theme.gitalk.clientID}',
46
- clientSecret: '#{theme.gitalk.clientSecret}',
47
- repo: '#{theme.gitalk.repo}',
48
- owner: '#{theme.gitalk.owner}',
49
- admin: #{theme.gitalk.admin},
50
- id: location.pathname, // Ensure uniqueness and length less than 50
51
- distractionFreeMode: false, // Facebook-like distraction free mode
52
- proxy: "#{gproxy}"
53
- });
54
- gitalk.render("gtcomments")
55
- else if gs
56
- div(class="wrap giscus" id="gscomments")
57
- script( src="https://giscus.app/client.js"
58
- data-repo="#{theme.giscus.repo}"
59
- data-repo-id="#{theme.giscus.repoId}"
60
- data-category="#{theme.giscus.category}"
61
- data-category-id="#{theme.giscus.categoryId}"
62
- data-mapping="#{theme.giscus.mapping}"
63
- data-strict="#{theme.giscus.strict}"
64
- data-reactions-enabled="#{theme.giscus.reactionsEnabled}"
65
- data-emit-metadata="#{theme.giscus.emitMetadata}"
66
- data-input-position="#{theme.giscus.inputPosition}"
67
- data-theme="#{theme.giscus.commentTheme}"
68
- data-lang="#{theme.giscus.lang}"
69
- data-loading="lazy"
70
- crossorigin="anonymous"
71
- async
72
- )
73
40
 
74
41
 
@@ -11,7 +11,7 @@ mixin SMRender(item)
11
11
  div(class="cover" style=`background: linear-gradient(to bottom right, ${random_color()}, ${random_color()});`)
12
12
  else
13
13
  div(class="cover")
14
- != _url(link1, '<img data-src="'+ _cover_index(item) +'" alt="article cover">', {itemprop: 'url', title: postText})
14
+ != _url(link1, '<img data-src="'+ _cover(item) +'" alt="article cover">', {itemprop: 'url', title: postText})
15
15
  div(class="info")
16
16
  +PMRender(item)
17
17
  h3
@@ -3,7 +3,7 @@
3
3
  - var siteTitle = config.title,noBaiduT = theme?.seo?.disable_baidu_transformation
4
4
  - var feedLink = full_url_for("/feed.json")
5
5
  - var tk= theme?.twikoo?.enable
6
- - var wl = theme.waline.enable,gt=theme?.gitalk?.enable
6
+ - var wl = theme.waline.enable
7
7
  meta(charset="UTF-8")
8
8
  meta(name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2")
9
9
  meta(name="theme-color" content="#222")
@@ -54,9 +54,6 @@ if tk
54
54
  script(src=theme.twikoo.link)
55
55
  else if wl
56
56
  link(rel="stylesheet" href="https://unpkg.com/@waline/client@v2/dist/waline.css")
57
- else if gt
58
- link(rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css")
59
- script(src="https://unpkg.com/gitalk/dist/gitalk.min.js")
60
57
 
61
58
  - var qw = theme?.qweather?.enable
62
59
  if qw
@@ -2,7 +2,7 @@ include ../_mixin/breadcrumb.pug
2
2
  include ../_mixin/sidebar.pug
3
3
  include ../_mixin/widgets.pug
4
4
 
5
- - var ignores = []
5
+ - ignores = []
6
6
  if (theme.quicklink.ignores)
7
7
  - ignores.push(theme.quicklink.ignores)
8
8
 
@@ -40,7 +40,7 @@ html(lang=page.language?page.language:config.language, style=theme.grayMode ? 'f
40
40
  - var coverImage = theme.experiments.fixedCover || "https://7ed.net/bing/api"
41
41
  img(src=coverImage)
42
42
  else
43
- - var covers = _cover(page, 6)
43
+ - var covers = _cover_index(page, 6)
44
44
  if covers.length === 6
45
45
  ul
46
46
  each image in covers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
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,31 +18,31 @@
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.2",
22
- "@typescript-eslint/eslint-plugin": "^6.13.1",
23
- "@typescript-eslint/parser": "^6.13.1",
21
+ "@types/node": "^20.10.6",
22
+ "@typescript-eslint/eslint-plugin": "^6.17.0",
23
+ "@typescript-eslint/parser": "^6.17.0",
24
24
  "chai": "^4.3.10",
25
- "eslint": "^8.55.0",
25
+ "eslint": "^8.56.0",
26
26
  "eslint-config-standard": "~17",
27
27
  "eslint-plugin-chai-friendly": "^0.7.2",
28
- "eslint-plugin-import": "^2.29.0",
29
- "eslint-plugin-n": "^16.3.1",
28
+ "eslint-plugin-import": "^2.29.1",
29
+ "eslint-plugin-n": "^16.6.1",
30
30
  "eslint-plugin-promise": "^6.1.1",
31
31
  "eslint-plugin-vue": "^9.19.2",
32
32
  "hexo-fs": "^4.1.1",
33
33
  "hexo-util": "^3.1.0",
34
- "instantsearch.js": "^4.60.0",
35
- "jsdom": "^23.0.1",
34
+ "instantsearch.js": "^4.63.0",
35
+ "jsdom": "^23.1.0",
36
36
  "mocha": "^10.2.0",
37
- "typescript": "^5.3.2",
38
- "vue": "^3.3.9"
37
+ "typescript": "^5.3.3",
38
+ "vue": "^3.4.5"
39
39
  },
40
40
  "dependencies": {
41
- "esbuild": "^0.19.8",
41
+ "esbuild": "^0.19.11",
42
42
  "hexo": "^7.0.0",
43
43
  "js-yaml": "^4.1.0",
44
44
  "lozad": "^1.16.0",
45
- "theme-shokax-anime": "^0.0.4",
45
+ "theme-shokax-anime": "^0.0.6",
46
46
  "theme-shokax-pjax": "^0.0.2"
47
47
  },
48
48
  "engines": {
@@ -15,7 +15,7 @@ hexo.extend.generator.register('index', function (locals) {
15
15
  let pages;
16
16
  const config = hexo.config;
17
17
  const sticky = locals.posts.find({ sticky: true }).sort(config.index_generator.order_by);
18
- const posts = locals.posts.find({ sticky: { $exists: false } }).sort(config.index_generator.order_by);
18
+ const posts = locals.posts.find({ sticky: { $in: [false, undefined] } }).sort(config.index_generator.order_by);
19
19
  const paginationDir = config.pagination_dir || 'page';
20
20
  const path = config.index_generator.path || '';
21
21
  const categories = locals.categories;
@@ -96,7 +96,8 @@ hexo.extend.generator.register('index', function (locals) {
96
96
  data: {
97
97
  __index: true,
98
98
  catlist,
99
- sticky
99
+ sticky,
100
+ current: 1,
100
101
  }
101
102
  }];
102
103
  }
@@ -18,7 +18,7 @@ Some features will be disabled or render incorrectly`);
18
18
  hexo.log.warn('[SXEC 201] Essential information(title, desc, lang, etc) config incorrectly, Page will render incorrectly');
19
19
  }
20
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');
21
+ hexo.log.warn('You are using an deprecated feature and it was removed in the v0.3.10');
22
22
  }
23
23
  });
24
24
  hexo.on('generateAfter', function () {
@@ -9,7 +9,7 @@ const canvasEl = document.createElement('canvas');
9
9
  canvasEl.style.cssText = 'position:fixed;top:0;left:0;pointer-events:none;z-index:9999999';
10
10
  document.body.appendChild(canvasEl);
11
11
  const ctx = canvasEl.getContext('2d');
12
- const numberOfParticules = 30;
12
+ const numberOfParticles = 30;
13
13
  let pointerX = 0;
14
14
  let pointerY = 0;
15
15
  const tap = 'click';
@@ -25,7 +25,7 @@ function updateCoords(e) {
25
25
  pointerX = e.clientX || (e.touches && e.touches[0].clientX);
26
26
  pointerY = e.clientY || (e.touches && e.touches[0].clientY);
27
27
  }
28
- function setParticuleDirection(p) {
28
+ function setParticleDirection(p) {
29
29
  const angle = theme_shokax_anime_1.default.random(0, 360) * Math.PI / 180;
30
30
  const value = theme_shokax_anime_1.default.random(50, 180);
31
31
  const radius = [-1, 1][theme_shokax_anime_1.default.random(0, 1)] * value;
@@ -34,7 +34,7 @@ function setParticuleDirection(p) {
34
34
  y: p.y + radius * Math.sin(angle)
35
35
  };
36
36
  }
37
- function createParticule(x, y) {
37
+ function createParticle(x, y) {
38
38
  const p = {
39
39
  x,
40
40
  y,
@@ -50,7 +50,7 @@ function createParticule(x, y) {
50
50
  };
51
51
  p.color = colors[theme_shokax_anime_1.default.random(0, colors.length - 1)];
52
52
  p.radius = theme_shokax_anime_1.default.random(16, 32);
53
- p.endPos = setParticuleDirection(p);
53
+ p.endPos = setParticleDirection(p);
54
54
  return p;
55
55
  }
56
56
  function createCircle(x, y) {
@@ -74,22 +74,22 @@ function createCircle(x, y) {
74
74
  };
75
75
  return p;
76
76
  }
77
- function renderParticule(targets) {
77
+ function renderParticle(targets) {
78
78
  for (const target of targets) {
79
79
  target.draw();
80
80
  }
81
81
  }
82
- function animateParticules(x, y) {
82
+ function animateParticles(x, y) {
83
83
  const circle = createCircle(x, y);
84
- const particules = [];
85
- for (let i = 0; i < numberOfParticules; i++) {
86
- particules.push(createParticule(x, y));
84
+ const particles = [];
85
+ for (let i = 0; i < numberOfParticles; i++) {
86
+ particles.push(createParticle(x, y));
87
87
  }
88
88
  (0, theme_shokax_anime_1.default)().timeline().add({
89
- targets: particules,
89
+ targets: particles,
90
90
  duration: theme_shokax_anime_1.default.random(1200, 1800),
91
91
  easing: 'easeOutExpo',
92
- update: renderParticule,
92
+ update: renderParticle,
93
93
  x: p => p.endPos.x,
94
94
  y: p => p.endPos.y,
95
95
  radius: 0.1
@@ -97,7 +97,7 @@ function animateParticules(x, y) {
97
97
  targets: circle,
98
98
  duration: theme_shokax_anime_1.default.random(1200, 1800),
99
99
  easing: 'easeOutExpo',
100
- update: renderParticule,
100
+ update: renderParticle,
101
101
  radius: theme_shokax_anime_1.default.random(80, 160),
102
102
  lineWidth: 0,
103
103
  alpha: {
@@ -133,7 +133,7 @@ function initFireworks() {
133
133
  }
134
134
  render.play();
135
135
  updateCoords(e);
136
- animateParticules(pointerX, pointerY);
136
+ animateParticles(pointerX, pointerY);
137
137
  }, false);
138
138
  setCanvasSize();
139
139
  window.addEventListener('resize', setCanvasSize, false);
@@ -81,7 +81,7 @@ const transition = (target, type, complete, begin) => {
81
81
  };
82
82
  exports.transition = transition;
83
83
  const pageScroll = (target, offset, complete) => {
84
- const opt = {
84
+ (0, theme_shokax_anime_1.default)({
85
85
  targets: typeof offset === 'number' && typeof target !== 'number' ? target.parentNode : document.scrollingElement,
86
86
  duration: 500,
87
87
  easing: 'easeInOutQuad',
@@ -89,7 +89,6 @@ const pageScroll = (target, offset, complete) => {
89
89
  complete() {
90
90
  complete && complete();
91
91
  }
92
- };
93
- (0, theme_shokax_anime_1.default)(opt).play();
92
+ }).play();
94
93
  };
95
94
  exports.pageScroll = pageScroll;