hexo-theme-particlex 2.7.6 → 2.8.1
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/README.md +13 -5
- package/_config.yml +1 -1
- package/layout/archives.ejs +5 -3
- package/layout/categories.ejs +8 -6
- package/layout/comment.ejs +66 -66
- package/layout/current.ejs +6 -2
- package/layout/import.ejs +23 -20
- package/layout/index.ejs +10 -2
- package/layout/layout.ejs +4 -1
- package/layout/post.ejs +6 -4
- package/layout/posts.ejs +3 -3
- package/layout/tags.ejs +8 -6
- package/package.json +2 -2
- package/source/js/lib/highlight.js +8 -8
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[ParticleX](https://github.com/theme-particlex/hexo-theme-particlex) 主题,诞生原因是因为原来的 [Particle](https://github.com/korilin/hexo-theme-particle) 主题不维护了,但是我觉得还是很好的。
|
4
4
|
|
5
|
-
原来用的是 Vue 2 + Ant Design Vue 1,现更新到 Vue 3,去除 Ant Design Vue 采用自定义样式,图标更改为 Font Awesome 6,CDN 改为
|
5
|
+
原来用的是 Vue 2 + Ant Design Vue 1,现更新到 Vue 3,去除 Ant Design Vue 采用自定义样式,图标更改为 Font Awesome 6,CDN 改为 ZStatic。
|
6
6
|
|
7
7
|
原项目 `README.md` 里说:
|
8
8
|
|
@@ -40,6 +40,12 @@ prismjs:
|
|
40
40
|
enable: false
|
41
41
|
```
|
42
42
|
|
43
|
+
如果使用 Hexo 7.0.0 之后的版本只需要修改为:
|
44
|
+
|
45
|
+
```yaml
|
46
|
+
syntax_highlighter:
|
47
|
+
```
|
48
|
+
|
43
49
|
如果使用 Pandoc 还需要设置一下:
|
44
50
|
|
45
51
|
```yaml
|
@@ -166,6 +172,8 @@ footer:
|
|
166
172
|
|
167
173
|
可以配合 [Hexo-Babel](https://github.com/theme-particlex/hexo-babel) 插件处理 JS 语法兼容。
|
168
174
|
|
175
|
+
Polyfill 在国内一些省份被墙,这里换成了阿里的 [Polyfill](https://polyfill.alicdn.com)。
|
176
|
+
|
169
177
|
```yaml
|
170
178
|
# Polyfill
|
171
179
|
# https://polyfill.io
|
@@ -250,14 +258,14 @@ search:
|
|
250
258
|
|
251
259
|
## 3.4. 评论配置
|
252
260
|
|
253
|
-
### 3.4.1.
|
261
|
+
### 3.4.1. giscus
|
254
262
|
|
255
|
-
|
263
|
+
giscus 是一个由 GitHub Discussions 支持的评论系统。
|
256
264
|
|
257
|
-
在 [
|
265
|
+
在 [giscus.app](https://giscus.app) 设置好各项后,会在下面生成一个 `<script>` 标签,在主题内填入即可。
|
258
266
|
|
259
267
|
```yaml
|
260
|
-
#
|
268
|
+
# giscus
|
261
269
|
# https://github.com/giscus/giscus
|
262
270
|
giscus:
|
263
271
|
enable: false
|
package/_config.yml
CHANGED
package/layout/archives.ejs
CHANGED
@@ -32,14 +32,16 @@
|
|
32
32
|
<i class="fa-solid fa-tags fa-fw"></i>
|
33
33
|
</span>
|
34
34
|
<% let prev; %>
|
35
|
-
<% post.tags.data.forEach(tag => { %>
|
35
|
+
<% post.tags.data.forEach((tag) => { %>
|
36
36
|
<span class="tag">
|
37
37
|
<%
|
38
|
-
const colors = theme.colors.filter(color => color !== prev);
|
38
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
39
39
|
let id = Math.floor(Math.random() * colors.length);
|
40
40
|
prev = colors[id];
|
41
41
|
%>
|
42
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
42
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
43
|
+
<%= tag.name %>
|
44
|
+
</a>
|
43
45
|
</span>
|
44
46
|
<% }); %>
|
45
47
|
</span>
|
package/layout/categories.ejs
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
<% let posts = []; %>
|
3
3
|
<div class="categories-tags">
|
4
4
|
<% let prev; %>
|
5
|
-
<% site.categories.
|
5
|
+
<% site.categories.forEach((category) => { %>
|
6
6
|
<%
|
7
7
|
const colors = is_category(category.name)
|
8
8
|
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
-
: theme.colors.filter(color => color !== prev);
|
9
|
+
: theme.colors.filter((color) => color !== prev);
|
10
10
|
let id = Math.floor(Math.random() * colors.length);
|
11
11
|
prev = colors[id];
|
12
12
|
%>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<% } %>
|
27
27
|
<% }); %>
|
28
28
|
</div>
|
29
|
-
<% posts.forEach(post => { %>
|
29
|
+
<% posts.forEach((post) => { %>
|
30
30
|
<div class="timeline">
|
31
31
|
<div class="timeline-tail"></div>
|
32
32
|
<div class="timeline-content">
|
@@ -51,14 +51,16 @@
|
|
51
51
|
<i class="fa-solid fa-tags fa-fw"></i>
|
52
52
|
</span>
|
53
53
|
<% let prev; %>
|
54
|
-
<% post.tags.data.forEach(tag => { %>
|
54
|
+
<% post.tags.data.forEach((tag) => { %>
|
55
55
|
<span class="tag">
|
56
56
|
<%
|
57
|
-
const colors = theme.colors.filter(color => color !== prev);
|
57
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
58
58
|
let id = Math.floor(Math.random() * colors.length);
|
59
59
|
prev = colors[id];
|
60
60
|
%>
|
61
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
61
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
62
|
+
<%= tag.name %>
|
63
|
+
</a>
|
62
64
|
</span>
|
63
65
|
<% }); %>
|
64
66
|
</span>
|
package/layout/comment.ejs
CHANGED
@@ -1,66 +1,66 @@
|
|
1
|
-
<% if (theme.giscus.enable) { %>
|
2
|
-
<script
|
3
|
-
src="<%- theme.giscus.src %>"
|
4
|
-
data-repo="<%- theme.giscus.repo %>"
|
5
|
-
data-repo-id="<%- theme.giscus.repoID %>"
|
6
|
-
data-category="<%- theme.giscus.category %>"
|
7
|
-
data-category-id="<%- theme.giscus.categoryID %>"
|
8
|
-
data-mapping="<%- theme.giscus.mapping %>"
|
9
|
-
data-strict="<%- theme.giscus.strict %>"
|
10
|
-
data-reactions-enabled="<%- theme.giscus.reactionsEnabled %>"
|
11
|
-
data-emit-metadata="<%- theme.giscus.emitMetadata %>"
|
12
|
-
data-input-position="<%- theme.giscus.inputPosition %>"
|
13
|
-
data-theme="<%- theme.giscus.theme %>"
|
14
|
-
data-lang="<%- theme.giscus.lang %>"
|
15
|
-
crossorigin
|
16
|
-
async
|
17
|
-
></script>
|
18
|
-
<% } %>
|
19
|
-
<% if (theme.gitalk.enable) { %>
|
20
|
-
<script>
|
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");
|
34
|
-
</script>
|
35
|
-
<% } %>
|
36
|
-
<% if (theme.waline.enable) { %>
|
37
|
-
<script>
|
38
|
-
Waline.init({
|
39
|
-
el: "#waline-container",
|
40
|
-
serverURL: "<%- theme.waline.serverURL %>",
|
41
|
-
commentCount: <%- theme.waline.commentCount %>,
|
42
|
-
pageview: <%- theme.waline.pageview %>,
|
43
|
-
emoji: "<%- (theme.waline.emoji) %>".split(","),
|
44
|
-
meta: "<%- (theme.waline.meta) %>".split(","),
|
45
|
-
requiredMeta: "<%- theme.waline.requiredMeta %>".split(","),
|
46
|
-
lang: "<%- theme.waline.lang %>",
|
47
|
-
wordLimit: <%- theme.waline.wordLimit %>,
|
48
|
-
pageSize: "<%- theme.waline.pageSize %>",
|
49
|
-
login: "<%- theme.waline.login %>",
|
50
|
-
<% if (theme.waline.locale) { %>
|
51
|
-
locale: <%- JSON.stringify(theme.waline.locale) %>,
|
52
|
-
<% } %>
|
53
|
-
});
|
54
|
-
</script>
|
55
|
-
<% } %>
|
56
|
-
<% if (theme.twikoo.enable) { %>
|
57
|
-
<script>
|
58
|
-
twikoo.init({
|
59
|
-
el: "#twikoo-container",
|
60
|
-
envId: "<%- theme.twikoo.envID %>",
|
61
|
-
region: "<%- theme.twikoo.region %>",
|
62
|
-
path: <%- theme.twikoo.path %>,
|
63
|
-
lang: "<%- theme.twikoo.lang %>",
|
64
|
-
})
|
65
|
-
</script>
|
66
|
-
<% } %>
|
1
|
+
<% if (theme.giscus.enable) { %>
|
2
|
+
<script
|
3
|
+
src="<%- theme.giscus.src %>"
|
4
|
+
data-repo="<%- theme.giscus.repo %>"
|
5
|
+
data-repo-id="<%- theme.giscus.repoID %>"
|
6
|
+
data-category="<%- theme.giscus.category %>"
|
7
|
+
data-category-id="<%- theme.giscus.categoryID %>"
|
8
|
+
data-mapping="<%- theme.giscus.mapping %>"
|
9
|
+
data-strict="<%- theme.giscus.strict %>"
|
10
|
+
data-reactions-enabled="<%- theme.giscus.reactionsEnabled %>"
|
11
|
+
data-emit-metadata="<%- theme.giscus.emitMetadata %>"
|
12
|
+
data-input-position="<%- theme.giscus.inputPosition %>"
|
13
|
+
data-theme="<%- theme.giscus.theme %>"
|
14
|
+
data-lang="<%- theme.giscus.lang %>"
|
15
|
+
crossorigin
|
16
|
+
async
|
17
|
+
></script>
|
18
|
+
<% } %>
|
19
|
+
<% if (theme.gitalk.enable) { %>
|
20
|
+
<script>
|
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");
|
34
|
+
</script>
|
35
|
+
<% } %>
|
36
|
+
<% if (theme.waline.enable) { %>
|
37
|
+
<script>
|
38
|
+
Waline.init({
|
39
|
+
el: "#waline-container",
|
40
|
+
serverURL: "<%- theme.waline.serverURL %>",
|
41
|
+
commentCount: <%- theme.waline.commentCount %>,
|
42
|
+
pageview: <%- theme.waline.pageview %>,
|
43
|
+
emoji: "<%- (theme.waline.emoji) %>".split(","),
|
44
|
+
meta: "<%- (theme.waline.meta) %>".split(","),
|
45
|
+
requiredMeta: "<%- theme.waline.requiredMeta %>".split(","),
|
46
|
+
lang: "<%- theme.waline.lang %>",
|
47
|
+
wordLimit: <%- theme.waline.wordLimit %>,
|
48
|
+
pageSize: "<%- theme.waline.pageSize %>",
|
49
|
+
login: "<%- theme.waline.login %>",
|
50
|
+
<% if (theme.waline.locale) { %>
|
51
|
+
locale: <%- JSON.stringify(theme.waline.locale) %>,
|
52
|
+
<% } %>
|
53
|
+
});
|
54
|
+
</script>
|
55
|
+
<% } %>
|
56
|
+
<% if (theme.twikoo.enable) { %>
|
57
|
+
<script>
|
58
|
+
twikoo.init({
|
59
|
+
el: "#twikoo-container",
|
60
|
+
envId: "<%- theme.twikoo.envID %>",
|
61
|
+
region: "<%- theme.twikoo.region %>",
|
62
|
+
path: <%- theme.twikoo.path %>,
|
63
|
+
lang: "<%- theme.twikoo.lang %>",
|
64
|
+
})
|
65
|
+
</script>
|
66
|
+
<% } %>
|
package/layout/current.ejs
CHANGED
@@ -8,10 +8,14 @@
|
|
8
8
|
<% } %>
|
9
9
|
<span class="current"><%= page.current %></span>
|
10
10
|
<% if (page.current + 1 <= page.total) { %>
|
11
|
-
<a class="page-num" href="<%- url_for("page/" + (page.current + 1)) %>"
|
11
|
+
<a class="page-num" href="<%- url_for("page/" + (page.current + 1)) %>">
|
12
|
+
<%= page.current + 1 %>
|
13
|
+
</a>
|
12
14
|
<% } %>
|
13
15
|
<% if (page.current + 2 <= page.total) { %>
|
14
|
-
<a class="page-num" href="<%- url_for("page/" + (page.current + 2)) %>"
|
16
|
+
<a class="page-num" href="<%- url_for("page/" + (page.current + 2)) %>">
|
17
|
+
<%= page.current + 2 %>
|
18
|
+
</a>
|
15
19
|
<% } %>
|
16
20
|
<% if (page.current + 3 <= page.total) { %>
|
17
21
|
<span class="page-omit">...</span>
|
package/layout/import.ejs
CHANGED
@@ -1,33 +1,36 @@
|
|
1
|
-
<link rel="preconnect" href="https://
|
2
|
-
<script src="https://
|
3
|
-
<link rel="stylesheet" href="https://
|
4
|
-
<link rel="preconnect" href="https://fonts.
|
5
|
-
<link rel="preconnect" href="https://gstatic.
|
6
|
-
<link
|
1
|
+
<link rel="preconnect" href="https://s4.zstatic.net" />
|
2
|
+
<script src="https://s4.zstatic.net/ajax/libs/vue/3.3.7/vue.global.prod.min.js"></script>
|
3
|
+
<link rel="stylesheet" href="https://s4.zstatic.net/ajax/libs/font-awesome/6.4.2/css/all.min.css" />
|
4
|
+
<link rel="preconnect" href="https://fonts.googleapis.cn" />
|
5
|
+
<link rel="preconnect" href="https://fonts.gstatic.cn" crossorigin />
|
6
|
+
<link
|
7
|
+
rel="stylesheet"
|
8
|
+
href="https://fonts.googleapis.cn/css2?family=Fira+Code:wght@400;500;600;700&family=Lexend:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;600;700;800;900&display=swap"
|
9
|
+
/>
|
7
10
|
<script> const mixins = {}; </script>
|
8
11
|
<% if (theme.polyfill.enable) { %>
|
9
|
-
<script src="https://polyfill.
|
12
|
+
<script src="https://polyfill.alicdn.com/v3/polyfill.min.js?features=<%- theme.polyfill.features %>"></script>
|
10
13
|
<% } %>
|
11
14
|
<% if (theme.highlight.enable) { %>
|
12
|
-
<script src="https://
|
13
|
-
<script src="https://
|
15
|
+
<script src="https://s4.zstatic.net/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
16
|
+
<script src="https://s4.zstatic.net/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
|
14
17
|
<link
|
15
18
|
rel="stylesheet"
|
16
|
-
href="https://
|
19
|
+
href="https://s4.zstatic.net/ajax/libs/highlight.js/11.9.0/styles/<%- theme.highlight.style %>.min.css"
|
17
20
|
/>
|
18
21
|
<script src="<%- url_for("/js/lib/highlight.js") %>"></script>
|
19
22
|
<% } %>
|
20
23
|
<% if (theme.math.enable) { %>
|
21
|
-
<script src="https://
|
22
|
-
<script src="https://
|
23
|
-
<link rel="stylesheet" href="https://
|
24
|
+
<script src="https://s4.zstatic.net/ajax/libs/KaTeX/0.16.9/katex.min.js"></script>
|
25
|
+
<script src="https://s4.zstatic.net/ajax/libs/KaTeX/0.16.9/contrib/auto-render.min.js"></script>
|
26
|
+
<link rel="stylesheet" href="https://s4.zstatic.net/ajax/libs/KaTeX/0.16.9/katex.min.css" />
|
24
27
|
<script src="<%- url_for("/js/lib/math.js") %>"></script>
|
25
28
|
<% } %>
|
26
29
|
<% if (theme.preview.enable) { %>
|
27
30
|
<script src="<%- url_for("/js/lib/preview.js") %>"></script>
|
28
31
|
<% } %>
|
29
32
|
<% if (theme.crypto.enable && typeof page.secret !== "undefined") { %>
|
30
|
-
<script src="https://
|
33
|
+
<script src="https://s4.zstatic.net/ajax/libs/crypto-js/4.2.0/crypto-js.min.js"></script>
|
31
34
|
<script src="<%- url_for("/js/lib/crypto.js") %>"></script>
|
32
35
|
<% } %>
|
33
36
|
<% if (type === "archives" && theme.search.enable) { %>
|
@@ -35,16 +38,16 @@
|
|
35
38
|
<% } %>
|
36
39
|
<% if (type === "post" && page.comments) { %>
|
37
40
|
<% if (theme.gitalk.enable) { %>
|
38
|
-
<script src="https://
|
39
|
-
<link rel="stylesheet" href="https://
|
41
|
+
<script src="https://s4.zstatic.net/ajax/libs/gitalk/1.8.0/gitalk.min.js"></script>
|
42
|
+
<link rel="stylesheet" href="https://s4.zstatic.net/ajax/libs/gitalk/1.8.0/gitalk.min.css" />
|
40
43
|
<% } %>
|
41
44
|
<% if (theme.waline.enable) { %>
|
42
|
-
<script src="https://
|
43
|
-
<link rel="stylesheet" href="https://
|
44
|
-
<link rel="stylesheet" href="https://
|
45
|
+
<script src="https://s4.zstatic.net/ajax/libs/waline/2.15.8/waline.min.js"></script>
|
46
|
+
<link rel="stylesheet" href="https://s4.zstatic.net/ajax/libs/waline/2.15.8/waline.min.css" />
|
47
|
+
<link rel="stylesheet" href="https://s4.zstatic.net/ajax/libs/waline/2.15.8/waline-meta.min.css" />
|
45
48
|
<% } %>
|
46
49
|
<% if (theme.twikoo.enable) { %>
|
47
|
-
<script src="https://
|
50
|
+
<script src="https://s4.zstatic.net/ajax/libs/twikoo/1.6.31/twikoo.all.min.js"></script>
|
48
51
|
<% } %>
|
49
52
|
<% } %>
|
50
53
|
<% if (type === "index") { %>
|
package/layout/index.ejs
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
<div id="home-head">
|
2
|
-
<div
|
2
|
+
<div
|
3
|
+
id="home-background"
|
4
|
+
ref="homeBackground"
|
5
|
+
data-images="<%- theme.background.map(url_for) %>"
|
6
|
+
></div>
|
3
7
|
<div id="home-info" @click="homeClick">
|
4
8
|
<span class="loop"></span>
|
5
9
|
<span class="loop"></span>
|
@@ -14,7 +18,11 @@
|
|
14
18
|
</span>
|
15
19
|
</div>
|
16
20
|
</div>
|
17
|
-
<div
|
21
|
+
<div
|
22
|
+
id="home-posts-wrap"
|
23
|
+
ref="homePostsWrap"
|
24
|
+
<%- theme.card.enable || 'class="home-posts-wrap-no-card"' %>
|
25
|
+
>
|
18
26
|
<div id="home-posts">
|
19
27
|
<%- partial("posts") %>
|
20
28
|
<%- partial("current") %>
|
package/layout/layout.ejs
CHANGED
@@ -20,7 +20,10 @@
|
|
20
20
|
<meta name="author" content="<%- config.author %>" />
|
21
21
|
<meta name="description" content="<%- config.description %>" />
|
22
22
|
<meta name="keywords" content="<%- config.keywords %>" />
|
23
|
-
<meta
|
23
|
+
<meta
|
24
|
+
name="viewport"
|
25
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
26
|
+
/>
|
24
27
|
<link rel="icon" href="<%- url_for(theme.avatar) %>" />
|
25
28
|
<%- partial("import", { type }) %>
|
26
29
|
</head>
|
package/layout/post.ejs
CHANGED
@@ -25,21 +25,23 @@
|
|
25
25
|
<i class="fa-solid fa-tags fa-fw"></i>
|
26
26
|
</span>
|
27
27
|
<% let prev; %>
|
28
|
-
<% page.tags.data.forEach(tag => { %>
|
28
|
+
<% page.tags.data.forEach((tag) => { %>
|
29
29
|
<span class="tag">
|
30
30
|
<%
|
31
|
-
const colors = theme.colors.filter(color => color !== prev);
|
31
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
32
32
|
let id = Math.floor(Math.random() * colors.length);
|
33
33
|
prev = colors[id];
|
34
34
|
%>
|
35
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
35
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
36
|
+
<%= tag.name %>
|
37
|
+
</a>
|
36
38
|
</span>
|
37
39
|
<% }); %>
|
38
40
|
</span>
|
39
41
|
<% } %>
|
40
42
|
</div>
|
41
43
|
<% if (theme.crypto.enable && typeof page.secret !== "undefined") { %>
|
42
|
-
<% const CryptoJS =
|
44
|
+
<% const CryptoJS = getCryptoJS(); %>
|
43
45
|
<input
|
44
46
|
id="crypto"
|
45
47
|
:class="['input', cryptoStatus]"
|
package/layout/posts.ejs
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
});
|
9
9
|
posts = posts.slice(current, config.index_generator.per_page + current);
|
10
10
|
%>
|
11
|
-
<% posts.forEach(post => { %>
|
11
|
+
<% posts.forEach((post) => { %>
|
12
12
|
<div class="post">
|
13
13
|
<a href="<%- url_for(post.path) %>">
|
14
14
|
<h2 class="post-title"><%= post.title %></h2>
|
@@ -59,10 +59,10 @@
|
|
59
59
|
</span>
|
60
60
|
<% } %>
|
61
61
|
<% let prev; %>
|
62
|
-
<% post.tags.data.forEach(tag => { %>
|
62
|
+
<% post.tags.data.forEach((tag) => { %>
|
63
63
|
<span class="tag">
|
64
64
|
<%
|
65
|
-
const colors = theme.colors.filter(color => color !== prev);
|
65
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
66
66
|
let id = Math.floor(Math.random() * colors.length);
|
67
67
|
prev = colors[id];
|
68
68
|
%>
|
package/layout/tags.ejs
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
<% let posts = []; %>
|
3
3
|
<div class="categories-tags">
|
4
4
|
<% let prev; %>
|
5
|
-
<% site.tags.
|
5
|
+
<% site.tags.forEach((tag) => { %>
|
6
6
|
<%
|
7
7
|
const colors = is_tag(tag.name)
|
8
8
|
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
-
: theme.colors.filter(color => color !== prev);
|
9
|
+
: theme.colors.filter((color) => color !== prev);
|
10
10
|
let id = Math.floor(Math.random() * colors.length);
|
11
11
|
prev = colors[id];
|
12
12
|
%>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<% } %>
|
27
27
|
<% }); %>
|
28
28
|
</div>
|
29
|
-
<% posts.forEach(post => { %>
|
29
|
+
<% posts.forEach((post) => { %>
|
30
30
|
<div class="timeline">
|
31
31
|
<div class="timeline-tail"></div>
|
32
32
|
<div class="timeline-content">
|
@@ -51,14 +51,16 @@
|
|
51
51
|
<i class="fa-solid fa-tags fa-fw"></i>
|
52
52
|
</span>
|
53
53
|
<% let prev; %>
|
54
|
-
<% post.tags.data.forEach(tag => { %>
|
54
|
+
<% post.tags.data.forEach((tag) => { %>
|
55
55
|
<span class="tag">
|
56
56
|
<%
|
57
|
-
const colors = theme.colors.filter(color => color !== prev);
|
57
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
58
58
|
let id = Math.floor(Math.random() * colors.length);
|
59
59
|
prev = colors[id];
|
60
60
|
%>
|
61
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
61
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
62
|
+
<%= tag.name %>
|
63
|
+
</a>
|
62
64
|
</span>
|
63
65
|
<% }); %>
|
64
66
|
</span>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-particlex",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.8.1",
|
4
4
|
"description": "A concise Hexo theme, based on Particle.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
},
|
22
22
|
"homepage": "https://github.com/theme-particlex/hexo-theme-particlex#readme",
|
23
23
|
"dependencies": {
|
24
|
-
"hexo-helper-crypto": "^1.1
|
24
|
+
"hexo-helper-crypto": "^1.2.1",
|
25
25
|
"hexo-renderer-ejs": "^2.0.0"
|
26
26
|
},
|
27
27
|
"scripts": {
|
@@ -7,8 +7,8 @@ mixins.highlight = {
|
|
7
7
|
this.renderers.push(this.highlight);
|
8
8
|
},
|
9
9
|
methods: {
|
10
|
-
sleep(
|
11
|
-
return new Promise(resolve => setTimeout(resolve,
|
10
|
+
sleep(ms) {
|
11
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
12
12
|
},
|
13
13
|
highlight() {
|
14
14
|
let codes = document.querySelectorAll("pre");
|
@@ -22,12 +22,12 @@ mixins.highlight = {
|
|
22
22
|
highlighted = code;
|
23
23
|
}
|
24
24
|
i.innerHTML = `
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
<div class="code-content hljs">${highlighted}</div>
|
26
|
+
<div class="language">${language}</div>
|
27
|
+
<div class="copycode">
|
28
|
+
<i class="fa-solid fa-copy fa-fw"></i>
|
29
|
+
<i class="fa-solid fa-check fa-fw"></i>
|
30
|
+
</div>
|
31
31
|
`;
|
32
32
|
let content = i.querySelector(".code-content");
|
33
33
|
hljs.lineNumbersBlock(content, { singleLine: true });
|