hexo-theme-particlex 2.6.0 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -121,8 +121,6 @@ menu:
121
121
 
122
122
  图标链接配置和导航栏配置相同
123
123
 
124
- **如果图标链接或友链为空,请在 `iconLinks:` 或 `friendLinks:` 后添加一个 `{}`**
125
-
126
124
  ```yaml
127
125
  # Side info card
128
126
  card:
@@ -131,7 +129,6 @@ card:
131
129
  Description
132
130
  ...
133
131
  iconLinks:
134
- {}
135
132
  friendLinks:
136
133
  Argvchs: https://argvchs.github.io
137
134
  ```
@@ -274,11 +271,7 @@ giscus:
274
271
 
275
272
  Gitalk 是一个基于 GitHub Issue 和 Preact 的评论系统
276
273
 
277
- 考虑到博客可能部署到多个网站同步评论,但 OAuth APP 只能有一个回调 URL,所以添加了 `sites` 参数用于多个网站的评论
278
-
279
- **同样如果没有其他网站,请在 `sites:` 后添加一个 `{}`**
280
-
281
- 由于 Gitalk 官方 CORS 代理用的是 Cloudflare,速度过慢,添加了 `proxy` 参数,搭建 CORS 代理可以看[这篇文章](https://argvchs.github.io/2022/07/04/build-cors-anywhere)
274
+ 由于 Gitalk 官方 CORS 代理用的是 Cloudflare,速度过慢,搭建 CORS 代理可以看[这篇文章](https://argvchs.github.io/2022/07/04/build-cors-anywhere)
282
275
 
283
276
  ```yaml
284
277
  # Gitalk
@@ -292,11 +285,6 @@ gitalk:
292
285
  admin: # GitHub repo owner and collaborators, only these guys can initialize github issues
293
286
  language: zh-CN # en, zh-CN, zh-TW, es-ES, fr, ru, de, pl and ko are currently available
294
287
  proxy: # CORS proxy
295
- sites: # Sites
296
- {}
297
- # www.example.com:
298
- # clientID:
299
- # clientSecret:
300
288
  ```
301
289
 
302
290
  ### 3.4.3. Waline
@@ -305,8 +293,6 @@ Waline 是一个简单、安全的评论系统
305
293
 
306
294
  详见:[在 ParticleX 上使用 Waline | Yuzi's Blog](https://blog.yuzi.dev/posts/bcb4ff00.html)
307
295
 
308
- **注意如果不需要 `locale` 参数,请在 `locale:` 后添加一个 `{}`**
309
-
310
296
  ```yaml
311
297
  # Waline
312
298
  # https://github.com/walinejs/waline
@@ -314,7 +300,6 @@ waline:
314
300
  enable: false
315
301
  serverURL: # Waline server address url, you should set this to your own link
316
302
  locale: # Locale: https://waline.js.org/guide/client/i18n.html#locale-option
317
- {}
318
303
  commentCount: true # If false, comment count will only be displayed in post page, not in home page
319
304
  pageview: false # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`
320
305
  emoji: # Custom emoji
package/_config.yml CHANGED
@@ -44,7 +44,6 @@ card:
44
44
  Description
45
45
  ...
46
46
  iconLinks:
47
- {}
48
47
  friendLinks:
49
48
  Argvchs: https://argvchs.github.io
50
49
 
@@ -114,11 +113,6 @@ gitalk:
114
113
  admin: # GitHub repo owner and collaborators, only these guys can initialize github issues
115
114
  language: zh-CN # en, zh-CN, zh-TW, es-ES, fr, ru, de, pl and ko are currently available
116
115
  proxy: # CORS proxy
117
- sites: # Sites
118
- {}
119
- # www.example.com:
120
- # clientID:
121
- # clientSecret:
122
116
 
123
117
  # Waline
124
118
  # https://github.com/walinejs/waline
@@ -126,7 +120,6 @@ waline:
126
120
  enable: false
127
121
  serverURL: # Waline server address url, you should set this to your own link
128
122
  locale: # Locale: https://waline.js.org/guide/client/i18n.html#locale-option
129
- {}
130
123
  commentCount: true # If false, comment count will only be displayed in post page, not in home page
131
124
  pageview: false # Pageviews count, Note: You should not enable both `waline.pageview` and `leancloud_visitors`
132
125
  emoji: # Custom emoji
@@ -31,7 +31,7 @@
31
31
  <span class="icon">
32
32
  <i class="fa-solid fa-tags fa-fw"></i>
33
33
  </span>
34
- <% post.tags.data.forEach(data => { %>
34
+ <% post.tags.data.forEach(tag => { %>
35
35
  <span class="tag">
36
36
  <%
37
37
  const color = [
@@ -43,7 +43,7 @@
43
43
  ];
44
44
  let id = Math.floor(Math.random() * color.length);
45
45
  %>
46
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
46
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
47
47
  </span>
48
48
  <% }); %>
49
49
  </span>
package/layout/card.ejs CHANGED
@@ -7,24 +7,24 @@
7
7
  <div class="description">
8
8
  <%- markdown(theme.card.description) %>
9
9
  </div>
10
- <% if (Object.keys(theme.card.iconLinks).length) { %>
10
+ <% if (theme.card.iconLinks) { %>
11
11
  <div class="icon-links">
12
- <% Object.keys(theme.card.iconLinks).forEach(key => { %>
12
+ <% Object.entries(theme.card.iconLinks).forEach(([key, value]) => { %>
13
13
  <span class="icon-link">
14
- <a href="<%- url_for(theme.card.iconLinks[key].link) %>">
14
+ <a href="<%- url_for(value.link) %>">
15
15
  <i
16
- class="fa-<%- theme.card.iconLinks[key].theme %> fa-<%- theme.card.iconLinks[key].name %> fa-fw"
16
+ class="fa-<%- value.theme %> fa-<%- value.name %> fa-fw"
17
17
  ></i>
18
18
  </a>
19
19
  </span>
20
20
  <% }); %>
21
21
  </div>
22
22
  <% } %>
23
- <% if (Object.keys(theme.card.friendLinks).length) { %>
23
+ <% if (theme.card.friendLinks) { %>
24
24
  <div class="friend-links">
25
- <% Object.keys(theme.card.friendLinks).forEach(key => { %>
25
+ <% Object.entries(theme.card.friendLinks).forEach(([key, value]) => { %>
26
26
  <div class="friend-link">
27
- <a href="<%- url_for(theme.card.friendLinks[key]) %>"><%= key %></a>
27
+ <a href="<%- url_for(value) %>"><%= key %></a>
28
28
  </div>
29
29
  <% }); %>
30
30
  </div>
@@ -48,7 +48,7 @@
48
48
  <span class="icon">
49
49
  <i class="fa-solid fa-tags fa-fw"></i>
50
50
  </span>
51
- <% post.tags.data.forEach(data => { %>
51
+ <% post.tags.data.forEach(tag => { %>
52
52
  <span class="tag">
53
53
  <%
54
54
  const color = [
@@ -60,7 +60,7 @@
60
60
  ];
61
61
  let id = Math.floor(Math.random() * color.length);
62
62
  %>
63
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
63
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
64
64
  </span>
65
65
  <% }); %>
66
66
  </span>
@@ -18,30 +18,19 @@
18
18
  <% } %>
19
19
  <% if (theme.gitalk.enable) { %>
20
20
  <script>
21
- (() => {
22
- let clientID = "<%- theme.gitalk.clientID %>",
23
- clientSecret = "<%- theme.gitalk.clientSecret %>";
24
- <% Object.keys(theme.gitalk.sites).forEach(key => { %>
25
- if (window.location.host === "<%- key %>") {
26
- clientID = "<%- theme.gitalk.sites[key].clientID %>";
27
- clientSecret = "<%- theme.gitalk.sites[key].clientSecret %>";
28
- }
29
- <% }); %>
30
- const gitalk = new Gitalk({
31
- clientID: clientID,
32
- clientSecret: clientSecret,
33
- repo: "<%- theme.gitalk.repo %>",
34
- owner: "<%- theme.gitalk.owner %>",
35
- admin: ["<%- theme.gitalk.admin %>"],
36
- language: "<%- theme.gitalk.language %>",
37
- id: location.pathname,
38
- distractionFreeMode: false,
39
- <% if (theme.gitalk.proxy) { %>
40
- proxy: "<%- theme.gitalk.proxy %>",
41
- <% } %>
42
- })
43
- gitalk.render("gitalk-container");
44
- })();
21
+ const gitalk = new Gitalk({
22
+ clientID: "<%- theme.gitalk.clientID %>",
23
+ clientSecret: "<%- theme.gitalk.clientSecret %>",
24
+ repo: "<%- theme.gitalk.repo %>",
25
+ owner: "<%- theme.gitalk.owner %>",
26
+ admin: "<%- theme.gitalk.admin %>".split(","),
27
+ language: "<%- theme.gitalk.language %>",
28
+ id: location.pathname,
29
+ <% if (theme.gitalk.proxy) { %>
30
+ proxy: "<%- theme.gitalk.proxy %>",
31
+ <% } %>
32
+ })
33
+ gitalk.render("gitalk-container");
45
34
  </script>
46
35
  <% } %>
47
36
  <% if (theme.waline.enable) { %>
@@ -51,14 +40,16 @@
51
40
  serverURL: "<%- theme.waline.serverURL %>",
52
41
  commentCount: <%- theme.waline.commentCount %>,
53
42
  pageview: <%- theme.waline.pageview %>,
54
- emoji: <%- JSON.stringify(theme.waline.emoji) %>,
55
- meta: <%- JSON.stringify(theme.waline.meta) %>,
56
- requiredMeta: <%- JSON.stringify(theme.waline.requiredMeta) %>,
43
+ emoji: "<%- (theme.waline.emoji) %>".split(","),
44
+ meta: "<%- (theme.waline.meta) %>".split(","),
45
+ requiredMeta: "<%- theme.waline.requiredMeta %>".split(","),
57
46
  lang: "<%- theme.waline.lang %>",
58
47
  wordLimit: <%- theme.waline.wordLimit %>,
59
48
  pageSize: "<%- theme.waline.pageSize %>",
60
49
  login: "<%- theme.waline.login %>",
50
+ <% if (theme.waline.locale) { %>
61
51
  locale: <%- JSON.stringify(theme.waline.locale) %>,
52
+ <% } %>
62
53
  });
63
54
  </script>
64
55
  <% } %>
package/layout/import.ejs CHANGED
@@ -40,7 +40,7 @@
40
40
  <link rel="stylesheet" href="https://cdn.staticfile.org/waline/2.14.8/waline-meta.min.css" />
41
41
  <% } %>
42
42
  <% if (theme.twikoo.enable) { %>
43
- <script src="https://cdn.staticfile.org/twikoo/1.6.10/twikoo.all.min.js"></script>
43
+ <script src="https://cdn.staticfile.org/twikoo/1.6.16/twikoo.all.min.js"></script>
44
44
  <% } %>
45
45
  <% } %>
46
46
  <% if (type === "index") { %>
package/layout/index.ejs CHANGED
@@ -1,5 +1,5 @@
1
1
  <div id="home-head">
2
- <div id="home-background" ref="homeBackground" data-images="<%- theme.background.map(i => url_for(i)) %>"></div>
2
+ <div id="home-background" ref="homeBackground" data-images="<%- theme.background.map(url_for) %>"></div>
3
3
  <div id="home-info" @click="homeClick">
4
4
  <span class="loop"></span>
5
5
  <span class="loop"></span>
package/layout/menu.ejs CHANGED
@@ -3,9 +3,9 @@
3
3
  <a class="title" href="<%- config.root %>">
4
4
  <span><%= config.title.toUpperCase() %></span>
5
5
  </a>
6
- <% Object.keys(theme.menu).forEach(key => { %>
7
- <a href="<%- url_for(theme.menu[key].link) %>">
8
- <i class="fa-<%- theme.menu[key].theme %> fa-<%- theme.menu[key].name %> fa-fw"></i>
6
+ <% Object.entries(theme.menu).forEach(([key, value]) => { %>
7
+ <a href="<%- url_for(value.link) %>">
8
+ <i class="fa-<%- value.theme %> fa-<%- value.name %> fa-fw"></i>
9
9
  <span>&ensp;<%= key %></span>
10
10
  </a>
11
11
  <% }); %>
@@ -17,11 +17,11 @@
17
17
  </div>
18
18
  <transition name="slide">
19
19
  <div class="items" v-show="showMenuItems">
20
- <% Object.keys(theme.menu).forEach(key => { %>
21
- <a href="<%- url_for(theme.menu[key].link) %>">
20
+ <% Object.entries(theme.menu).forEach(([key, value]) => { %>
21
+ <a href="<%- url_for(value.link) %>">
22
22
  <div class="item">
23
23
  <div style="min-width: 20px; max-width: 50px; width: 10%">
24
- <i class="fa-<%- theme.menu[key].theme %> fa-<%- theme.menu[key].name %> fa-fw"></i>
24
+ <i class="fa-<%- value.theme %> fa-<%- value.name %> fa-fw"></i>
25
25
  </div>
26
26
  <div style="min-width: 100px; max-width: 150%; width: 20%"><%= key %></div>
27
27
  </div>
package/layout/post.ejs CHANGED
@@ -24,7 +24,7 @@
24
24
  <span class="icon">
25
25
  <i class="fa-solid fa-tags fa-fw"></i>
26
26
  </span>
27
- <% page.tags.data.forEach(data => { %>
27
+ <% page.tags.data.forEach(tag => { %>
28
28
  <span class="tag">
29
29
  <%
30
30
  const color = [
@@ -36,7 +36,7 @@
36
36
  ];
37
37
  let id = Math.floor(Math.random() * color.length);
38
38
  %>
39
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
39
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
40
40
  </span>
41
41
  <% }); %>
42
42
  </span>
package/layout/posts.ejs CHANGED
@@ -58,7 +58,7 @@
58
58
  <i class="fa-solid fa-tags fa-fw"></i>
59
59
  </span>
60
60
  <% } %>
61
- <% post.tags.data.forEach(data => { %>
61
+ <% post.tags.data.forEach(tag => { %>
62
62
  <span class="tag">
63
63
  <%
64
64
  const color = [
@@ -70,7 +70,7 @@
70
70
  ];
71
71
  let id = Math.floor(Math.random() * color.length);
72
72
  %>
73
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
73
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
74
74
  </span>
75
75
  <% }); %>
76
76
  </div>
package/layout/tags.ejs CHANGED
@@ -33,7 +33,7 @@
33
33
  <h3><%= post.title %></h3>
34
34
  </a>
35
35
  <div class="info">
36
- <% if (post.categories && post.categories.data.length !== 0){ %>
36
+ <% if (post.categories && post.categories.data.length){ %>
37
37
  <span class="category">
38
38
  <a href="<%- url_for(post.categories.data[0].path) %>">
39
39
  <span class="icon">
@@ -48,7 +48,7 @@
48
48
  <span class="icon">
49
49
  <i class="fa-solid fa-tags fa-fw"></i>
50
50
  </span>
51
- <% post.tags.data.forEach(data => { %>
51
+ <% post.tags.data.forEach(tag => { %>
52
52
  <span class="tag">
53
53
  <%
54
54
  const color = [
@@ -60,7 +60,7 @@
60
60
  ];
61
61
  let id = Math.floor(Math.random() * color.length);
62
62
  %>
63
- <a href="<%- url_for(data.path) %>" style="<%- color[id] %>"><%= data.name %></a>
63
+ <a href="<%- url_for(tag.path) %>" style="<%- color[id] %>"><%= tag.name %></a>
64
64
  </span>
65
65
  <% }); %>
66
66
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-particlex",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "A concise Hexo theme, based on Particle.",
5
5
  "repository": {
6
6
  "type": "git",