hexo-theme-particlex 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -1
- package/layout/archives.ejs +5 -3
- package/layout/categories.ejs +72 -70
- package/layout/comment.ejs +66 -66
- package/layout/current.ejs +6 -2
- package/layout/import.ejs +7 -4
- 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 +72 -70
- package/package.json +2 -2
- package/source/js/lib/highlight.js +8 -8
package/README.md
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
# 2. 安装
|
20
20
|
|
21
|
-
```
|
21
|
+
```bash
|
22
22
|
cd themes
|
23
23
|
git clone https://github.com/theme-particlex/hexo-theme-particlex.git particlex --depth=1
|
24
24
|
```
|
@@ -172,6 +172,8 @@ footer:
|
|
172
172
|
|
173
173
|
可以配合 [Hexo-Babel](https://github.com/theme-particlex/hexo-babel) 插件处理 JS 语法兼容。
|
174
174
|
|
175
|
+
Polyfill 在国内一些省份被墙,这里换成了阿里的 [Polyfill](https://polyfill.alicdn.com)。
|
176
|
+
|
175
177
|
```yaml
|
176
178
|
# Polyfill
|
177
179
|
# https://polyfill.io
|
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
@@ -1,70 +1,72 @@
|
|
1
|
-
<div id="archives">
|
2
|
-
<% let posts = []; %>
|
3
|
-
<div class="categories-tags">
|
4
|
-
<% let prev; %>
|
5
|
-
<% site.categories.forEach(category => { %>
|
6
|
-
<%
|
7
|
-
const colors = is_category(category.name)
|
8
|
-
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
-
: theme.colors.filter(color => color !== prev);
|
10
|
-
let id = Math.floor(Math.random() * colors.length);
|
11
|
-
prev = colors[id];
|
12
|
-
%>
|
13
|
-
<span>
|
14
|
-
<a href="<%- url_for(category.path) %>" style="background: <%- colors[id] %>">
|
15
|
-
<span class="icon">
|
16
|
-
<i class="fa-solid fa-bookmark fa-fw"></i>
|
17
|
-
</span>
|
18
|
-
<%= category.name %>
|
19
|
-
</a>
|
20
|
-
</span>
|
21
|
-
<% if (is_category(category.name)) { %>
|
22
|
-
<%
|
23
|
-
posts = category.posts;
|
24
|
-
posts.data.sort((a, b) => b.date - a.date);
|
25
|
-
%>
|
26
|
-
<% } %>
|
27
|
-
<% }); %>
|
28
|
-
</div>
|
29
|
-
<% posts.forEach(post => { %>
|
30
|
-
<div class="timeline">
|
31
|
-
<div class="timeline-tail"></div>
|
32
|
-
<div class="timeline-content">
|
33
|
-
<div class="item-time"><%= date(post.date, "YYYY/M/D") %></div>
|
34
|
-
<a href="<%- url_for(post.path) %>">
|
35
|
-
<h3><%= post.title %></h3>
|
36
|
-
</a>
|
37
|
-
<div class="info">
|
38
|
-
<% if (post.categories && post.categories.data.length !== 0) { %>
|
39
|
-
<span class="category">
|
40
|
-
<a href="<%- url_for(post.categories.data[0].path) %>">
|
41
|
-
<span class="icon">
|
42
|
-
<i class="fa-solid fa-bookmark fa-fw"></i>
|
43
|
-
</span>
|
44
|
-
<%= post.categories.data[0].name %>
|
45
|
-
</a>
|
46
|
-
</span>
|
47
|
-
<% } %>
|
48
|
-
<% if (post.tags && post.tags.data.length !== 0) { %>
|
49
|
-
<span class="tags">
|
50
|
-
<span class="icon">
|
51
|
-
<i class="fa-solid fa-tags fa-fw"></i>
|
52
|
-
</span>
|
53
|
-
<% let prev; %>
|
54
|
-
<% post.tags.data.forEach(tag => { %>
|
55
|
-
<span class="tag">
|
56
|
-
<%
|
57
|
-
const colors = theme.colors.filter(color => color !== prev);
|
58
|
-
let id = Math.floor(Math.random() * colors.length);
|
59
|
-
prev = colors[id];
|
60
|
-
%>
|
61
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</div>
|
1
|
+
<div id="archives">
|
2
|
+
<% let posts = []; %>
|
3
|
+
<div class="categories-tags">
|
4
|
+
<% let prev; %>
|
5
|
+
<% site.categories.forEach((category) => { %>
|
6
|
+
<%
|
7
|
+
const colors = is_category(category.name)
|
8
|
+
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
+
: theme.colors.filter((color) => color !== prev);
|
10
|
+
let id = Math.floor(Math.random() * colors.length);
|
11
|
+
prev = colors[id];
|
12
|
+
%>
|
13
|
+
<span>
|
14
|
+
<a href="<%- url_for(category.path) %>" style="background: <%- colors[id] %>">
|
15
|
+
<span class="icon">
|
16
|
+
<i class="fa-solid fa-bookmark fa-fw"></i>
|
17
|
+
</span>
|
18
|
+
<%= category.name %>
|
19
|
+
</a>
|
20
|
+
</span>
|
21
|
+
<% if (is_category(category.name)) { %>
|
22
|
+
<%
|
23
|
+
posts = category.posts;
|
24
|
+
posts.data.sort((a, b) => b.date - a.date);
|
25
|
+
%>
|
26
|
+
<% } %>
|
27
|
+
<% }); %>
|
28
|
+
</div>
|
29
|
+
<% posts.forEach((post) => { %>
|
30
|
+
<div class="timeline">
|
31
|
+
<div class="timeline-tail"></div>
|
32
|
+
<div class="timeline-content">
|
33
|
+
<div class="item-time"><%= date(post.date, "YYYY/M/D") %></div>
|
34
|
+
<a href="<%- url_for(post.path) %>">
|
35
|
+
<h3><%= post.title %></h3>
|
36
|
+
</a>
|
37
|
+
<div class="info">
|
38
|
+
<% if (post.categories && post.categories.data.length !== 0) { %>
|
39
|
+
<span class="category">
|
40
|
+
<a href="<%- url_for(post.categories.data[0].path) %>">
|
41
|
+
<span class="icon">
|
42
|
+
<i class="fa-solid fa-bookmark fa-fw"></i>
|
43
|
+
</span>
|
44
|
+
<%= post.categories.data[0].name %>
|
45
|
+
</a>
|
46
|
+
</span>
|
47
|
+
<% } %>
|
48
|
+
<% if (post.tags && post.tags.data.length !== 0) { %>
|
49
|
+
<span class="tags">
|
50
|
+
<span class="icon">
|
51
|
+
<i class="fa-solid fa-tags fa-fw"></i>
|
52
|
+
</span>
|
53
|
+
<% let prev; %>
|
54
|
+
<% post.tags.data.forEach((tag) => { %>
|
55
|
+
<span class="tag">
|
56
|
+
<%
|
57
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
58
|
+
let id = Math.floor(Math.random() * colors.length);
|
59
|
+
prev = colors[id];
|
60
|
+
%>
|
61
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
62
|
+
<%= tag.name %>
|
63
|
+
</a>
|
64
|
+
</span>
|
65
|
+
<% }); %>
|
66
|
+
</span>
|
67
|
+
<% } %>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<% }); %>
|
72
|
+
</div>
|
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,12 +1,15 @@
|
|
1
1
|
<link rel="preconnect" href="https://s4.zstatic.net" />
|
2
2
|
<script src="https://s4.zstatic.net/ajax/libs/vue/3.3.7/vue.global.prod.min.js"></script>
|
3
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.
|
5
|
-
<link rel="preconnect" href="https://gstatic.
|
6
|
-
<link
|
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
15
|
<script src="https://s4.zstatic.net/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
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
@@ -1,70 +1,72 @@
|
|
1
|
-
<div id="archives">
|
2
|
-
<% let posts = []; %>
|
3
|
-
<div class="categories-tags">
|
4
|
-
<% let prev; %>
|
5
|
-
<% site.tags.forEach(tag => { %>
|
6
|
-
<%
|
7
|
-
const colors = is_tag(tag.name)
|
8
|
-
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
-
: theme.colors.filter(color => color !== prev);
|
10
|
-
let id = Math.floor(Math.random() * colors.length);
|
11
|
-
prev = colors[id];
|
12
|
-
%>
|
13
|
-
<span>
|
14
|
-
<a href="<%- url_for(tag.path) %>" style="background: <%- colors[id] %>">
|
15
|
-
<span class="icon">
|
16
|
-
<i class="fa-solid fa-tags fa-fw"></i>
|
17
|
-
</span>
|
18
|
-
<%= tag.name %>
|
19
|
-
</a>
|
20
|
-
</span>
|
21
|
-
<% if (is_tag(tag.name)) { %>
|
22
|
-
<%
|
23
|
-
posts = tag.posts;
|
24
|
-
posts.data.sort((a, b) => b.date - a.date);
|
25
|
-
%>
|
26
|
-
<% } %>
|
27
|
-
<% }); %>
|
28
|
-
</div>
|
29
|
-
<% posts.forEach(post => { %>
|
30
|
-
<div class="timeline">
|
31
|
-
<div class="timeline-tail"></div>
|
32
|
-
<div class="timeline-content">
|
33
|
-
<div class="item-time"><%= date(post.date, "YYYY/M/D") %></div>
|
34
|
-
<a href="<%- url_for(post.path) %>">
|
35
|
-
<h3><%= post.title %></h3>
|
36
|
-
</a>
|
37
|
-
<div class="info">
|
38
|
-
<% if (post.categories && post.categories.data.length !== 0) { %>
|
39
|
-
<span class="category">
|
40
|
-
<a href="<%- url_for(post.categories.data[0].path) %>">
|
41
|
-
<span class="icon">
|
42
|
-
<i class="fa-solid fa-bookmark fa-fw"></i>
|
43
|
-
</span>
|
44
|
-
<%= post.categories.data[0].name %>
|
45
|
-
</a>
|
46
|
-
</span>
|
47
|
-
<% } %>
|
48
|
-
<% if (post.tags && post.tags.data.length !== 0) { %>
|
49
|
-
<span class="tags">
|
50
|
-
<span class="icon">
|
51
|
-
<i class="fa-solid fa-tags fa-fw"></i>
|
52
|
-
</span>
|
53
|
-
<% let prev; %>
|
54
|
-
<% post.tags.data.forEach(tag => { %>
|
55
|
-
<span class="tag">
|
56
|
-
<%
|
57
|
-
const colors = theme.colors.filter(color => color !== prev);
|
58
|
-
let id = Math.floor(Math.random() * colors.length);
|
59
|
-
prev = colors[id];
|
60
|
-
%>
|
61
|
-
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</div>
|
1
|
+
<div id="archives">
|
2
|
+
<% let posts = []; %>
|
3
|
+
<div class="categories-tags">
|
4
|
+
<% let prev; %>
|
5
|
+
<% site.tags.forEach((tag) => { %>
|
6
|
+
<%
|
7
|
+
const colors = is_tag(tag.name)
|
8
|
+
? ["linear-gradient(120deg, #9abbf7 0%, #ffbbf4 100%)"]
|
9
|
+
: theme.colors.filter((color) => color !== prev);
|
10
|
+
let id = Math.floor(Math.random() * colors.length);
|
11
|
+
prev = colors[id];
|
12
|
+
%>
|
13
|
+
<span>
|
14
|
+
<a href="<%- url_for(tag.path) %>" style="background: <%- colors[id] %>">
|
15
|
+
<span class="icon">
|
16
|
+
<i class="fa-solid fa-tags fa-fw"></i>
|
17
|
+
</span>
|
18
|
+
<%= tag.name %>
|
19
|
+
</a>
|
20
|
+
</span>
|
21
|
+
<% if (is_tag(tag.name)) { %>
|
22
|
+
<%
|
23
|
+
posts = tag.posts;
|
24
|
+
posts.data.sort((a, b) => b.date - a.date);
|
25
|
+
%>
|
26
|
+
<% } %>
|
27
|
+
<% }); %>
|
28
|
+
</div>
|
29
|
+
<% posts.forEach((post) => { %>
|
30
|
+
<div class="timeline">
|
31
|
+
<div class="timeline-tail"></div>
|
32
|
+
<div class="timeline-content">
|
33
|
+
<div class="item-time"><%= date(post.date, "YYYY/M/D") %></div>
|
34
|
+
<a href="<%- url_for(post.path) %>">
|
35
|
+
<h3><%= post.title %></h3>
|
36
|
+
</a>
|
37
|
+
<div class="info">
|
38
|
+
<% if (post.categories && post.categories.data.length !== 0) { %>
|
39
|
+
<span class="category">
|
40
|
+
<a href="<%- url_for(post.categories.data[0].path) %>">
|
41
|
+
<span class="icon">
|
42
|
+
<i class="fa-solid fa-bookmark fa-fw"></i>
|
43
|
+
</span>
|
44
|
+
<%= post.categories.data[0].name %>
|
45
|
+
</a>
|
46
|
+
</span>
|
47
|
+
<% } %>
|
48
|
+
<% if (post.tags && post.tags.data.length !== 0) { %>
|
49
|
+
<span class="tags">
|
50
|
+
<span class="icon">
|
51
|
+
<i class="fa-solid fa-tags fa-fw"></i>
|
52
|
+
</span>
|
53
|
+
<% let prev; %>
|
54
|
+
<% post.tags.data.forEach((tag) => { %>
|
55
|
+
<span class="tag">
|
56
|
+
<%
|
57
|
+
const colors = theme.colors.filter((color) => color !== prev);
|
58
|
+
let id = Math.floor(Math.random() * colors.length);
|
59
|
+
prev = colors[id];
|
60
|
+
%>
|
61
|
+
<a href="<%- url_for(tag.path) %>" style="color: <%- colors[id] %>">
|
62
|
+
<%= tag.name %>
|
63
|
+
</a>
|
64
|
+
</span>
|
65
|
+
<% }); %>
|
66
|
+
</span>
|
67
|
+
<% } %>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<% }); %>
|
72
|
+
</div>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-particlex",
|
3
|
-
"version": "2.8.
|
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 });
|