hexo-theme-particlex 2.3.5 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/dependabot.yml +6 -0
- package/README.md +2 -2
- package/layout/archives.ejs +2 -2
- package/layout/categories.ejs +2 -2
- package/layout/current.ejs +6 -6
- package/layout/layout.ejs +3 -3
- package/layout/post.ejs +4 -4
- package/layout/posts.ejs +6 -6
- package/layout/script.ejs +2 -2
- package/layout/tags.ejs +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
@@ -189,11 +189,11 @@ highlightStyle: github # Highlight style
|
|
189
189
|
|
190
190
|
- 文章置顶
|
191
191
|
|
192
|
-
在 [Front-Matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `
|
192
|
+
在 [Front-Matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `pin` 作为置顶参数,越大越靠前,默认为 0
|
193
193
|
|
194
194
|
- 文章加密
|
195
195
|
|
196
|
-
使用 AES 加密算法,在 [Front-Matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `
|
196
|
+
使用 AES 加密算法,在 [Front-Matter](https://hexo.io/zh-cn/docs/front-matter) 里设置 `secret` 作为密码,**使用请安装插件 [Hexo-Helper-Crypto](https://github.com/argvchs/hexo-helper-crypto)**
|
197
197
|
|
198
198
|
```yaml
|
199
199
|
crypto:
|
package/layout/archives.ejs
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
<h3><%= post.title %></h3>
|
17
17
|
</a>
|
18
18
|
<div class="info">
|
19
|
-
<% if (post.categories && post.categories.data.length
|
19
|
+
<% if (post.categories && post.categories.data.length !== 0) { %>
|
20
20
|
<span class="category">
|
21
21
|
<a href="<%- url_for(post.categories.data[0].path) %>">
|
22
22
|
<span class="icon">
|
@@ -26,7 +26,7 @@
|
|
26
26
|
</a>
|
27
27
|
</span>
|
28
28
|
<% } %>
|
29
|
-
<% if (post.tags && post.tags.data.length
|
29
|
+
<% if (post.tags && post.tags.data.length !== 0) { %>
|
30
30
|
<span class="tags">
|
31
31
|
<span class="icon">
|
32
32
|
<i class="fa-solid fa-tags fa-fw"></i>
|
package/layout/categories.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
|
36
|
+
<% if (post.categories && post.categories.data.length !== 0) { %>
|
37
37
|
<span class="category">
|
38
38
|
<a href="<%- url_for(post.categories.data[0].path) %>">
|
39
39
|
<span class="icon">
|
@@ -43,7 +43,7 @@
|
|
43
43
|
</a>
|
44
44
|
</span>
|
45
45
|
<% } %>
|
46
|
-
<% if (post.tags && post.tags.data.length
|
46
|
+
<% if (post.tags && post.tags.data.length !== 0) { %>
|
47
47
|
<span class="tags">
|
48
48
|
<span class="icon">
|
49
49
|
<i class="fa-solid fa-tags fa-fw"></i>
|
package/layout/current.ejs
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
<div class="page-current">
|
2
2
|
<div class="prev">
|
3
|
-
<% if (page.current
|
3
|
+
<% if (page.current !== 1) { %>
|
4
4
|
<a class="page-num" href="<%- url_for(page.prev_link) %>">
|
5
5
|
<i class="fa-solid fa-caret-left fa-fw"></i>
|
6
6
|
</a>
|
7
7
|
<% } %>
|
8
8
|
</div>
|
9
9
|
<div class="page-index">
|
10
|
-
<% if (page.current
|
10
|
+
<% if (page.current !== 1) { %>
|
11
11
|
<span>
|
12
12
|
<% if (page.current - 3 >= 1) { %>
|
13
13
|
<a class="page-num" href="<%- config.root %>">1</a>
|
14
14
|
<span class="page-omit">...</span>
|
15
15
|
<% } %>
|
16
16
|
<% if (page.current - 2 >= 1) { %>
|
17
|
-
<% if (page.current - 2
|
17
|
+
<% if (page.current - 2 === 1) { %>
|
18
18
|
<a class="page-num" href="<%- config.root %>">1</a>
|
19
19
|
<% } %>
|
20
|
-
<% if (page.current - 2
|
20
|
+
<% if (page.current - 2 !== 1) { %>
|
21
21
|
<a class="page-num" href="<%- url_for("page/" + (page.current - 2)) %>"><%= page.current - 2 %></a>
|
22
22
|
<% } %>
|
23
23
|
<% } %>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</span>
|
26
26
|
<% } %>
|
27
27
|
<span class="current"><%= page.current %></span>
|
28
|
-
<% if (page.current
|
28
|
+
<% if (page.current !== page.total) { %>
|
29
29
|
<span>
|
30
30
|
<a class="page-num" href="<%- url_for(page.next_link) %>"><%= page.next %></a>
|
31
31
|
<% if (page.current + 2 <= page.total) { %>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<% } %>
|
40
40
|
</div>
|
41
41
|
<div class="next">
|
42
|
-
<% if (page.current
|
42
|
+
<% if (page.current !== page.total) { %>
|
43
43
|
<a class="page-num" href="<%- url_for(page.next_link) %>">
|
44
44
|
<i class="fa-solid fa-caret-right fa-fw"></i>
|
45
45
|
</a>
|
package/layout/layout.ejs
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
type = "index";
|
5
5
|
else if (is_post())
|
6
6
|
type = "post";
|
7
|
-
else if (is_category() || page.type
|
7
|
+
else if (is_category() || page.type === "categories")
|
8
8
|
type = "categories";
|
9
|
-
else if (is_tag() || page.type
|
9
|
+
else if (is_tag() || page.type === "tags")
|
10
10
|
type = "tags";
|
11
11
|
else if (is_archive())
|
12
12
|
type = "archives";
|
@@ -43,7 +43,7 @@
|
|
43
43
|
<script src="https://cdn.staticfile.org/KaTeX/0.16.4/contrib/auto-render.min.js"></script>
|
44
44
|
<link rel="stylesheet" href="https://cdn.staticfile.org/KaTeX/0.16.4/katex.min.css">
|
45
45
|
<% } %>
|
46
|
-
<% if (theme.crypto.enable && typeof page.
|
46
|
+
<% if (theme.crypto.enable && typeof page.secret !== "undefined") { %>
|
47
47
|
<script src="https://cdn.staticfile.org/crypto-js/4.1.1/crypto-js.min.js"></script>
|
48
48
|
<% } %>
|
49
49
|
<link rel="stylesheet" href="<%- url_for("/css/fonts.min.css") %>">
|
package/layout/post.ejs
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
</span>
|
10
10
|
<%= date(page.date, "YYYY/M/D") %>
|
11
11
|
</span>
|
12
|
-
<% if (page.categories && page.categories.data.length
|
12
|
+
<% if (page.categories && page.categories.data.length !== 0) { %>
|
13
13
|
<span class="category">
|
14
14
|
<a href="<%- url_for(page.categories.data[0].path) %>">
|
15
15
|
<span class="icon">
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</a>
|
20
20
|
</span>
|
21
21
|
<% } %>
|
22
|
-
<% if (page.tags && page.tags.data.length
|
22
|
+
<% if (page.tags && page.tags.data.length !== 0) { %>
|
23
23
|
<span class="tags">
|
24
24
|
<span class="icon">
|
25
25
|
<i class="fa-solid fa-tags fa-fw"></i>
|
@@ -36,7 +36,7 @@
|
|
36
36
|
</span>
|
37
37
|
<% } %>
|
38
38
|
</div>
|
39
|
-
<% if (theme.crypto.enable && typeof page.
|
39
|
+
<% if (theme.crypto.enable && typeof page.secret !== "undefined") { %>
|
40
40
|
<%
|
41
41
|
const CryptoJS = crypto();
|
42
42
|
function sha(str) {
|
@@ -46,7 +46,7 @@
|
|
46
46
|
return CryptoJS.AES.encrypt(str, key).toString();
|
47
47
|
}
|
48
48
|
%>
|
49
|
-
<input id="crypto" class="input" placeholder="文章被加密,请输入密码" data-encrypt="<%- encrypt(page.content, page.
|
49
|
+
<input id="crypto" class="input" placeholder="文章被加密,请输入密码" data-encrypt="<%- encrypt(page.content, page.secret) %>" data-shasum="<%- sha(page.content) %>">
|
50
50
|
<div class="content" v-pre style="opacity: 0"></div>
|
51
51
|
<% } else { %>
|
52
52
|
<div class="content" v-pre>
|
package/layout/posts.ejs
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
let posts = site.posts,
|
3
3
|
current = (page.current - 1) * config.index_generator.per_page;
|
4
4
|
posts.data.sort((a, b) => {
|
5
|
-
let
|
6
|
-
return
|
5
|
+
let pina = a.pin ?? 0, pinb = b.pin ?? 0;
|
6
|
+
return pina === pinb ? b.date - a.date : pinb - pina;
|
7
7
|
});
|
8
8
|
posts = posts.slice(current, config.index_generator.per_page + current);
|
9
9
|
%>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<h2 class="post-title"><%= post.title %></h2>
|
14
14
|
</a>
|
15
15
|
<div class="category-and-date">
|
16
|
-
<% if (post.categories.data.length
|
16
|
+
<% if (post.categories.data.length !== 0) { %>
|
17
17
|
<span class="category">
|
18
18
|
<a href="<%- url_for(post.categories.data[0].path) %>">
|
19
19
|
<span class="icon">
|
@@ -29,12 +29,12 @@
|
|
29
29
|
</span>
|
30
30
|
<%- date(post.date, "YYYY/M/D") %>
|
31
31
|
</span>
|
32
|
-
<% if (theme.crypto.enable && typeof post.
|
32
|
+
<% if (theme.crypto.enable && typeof post.secret !== "undefined") { %>
|
33
33
|
<span class="special">
|
34
34
|
<i class="fa-solid fa-lock fa-fw"></i>
|
35
35
|
</span>
|
36
36
|
<% } %>
|
37
|
-
<% if (typeof post.
|
37
|
+
<% if (typeof post.pin !== "undefined" && post.pin > 0) { %>
|
38
38
|
<span class="special">
|
39
39
|
<i class="fa-solid fa-grip-vertical fa-fw"></i>
|
40
40
|
</span>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
</div>
|
53
53
|
</div>
|
54
54
|
<div class="post-tags">
|
55
|
-
<% if (post.tags.data.length
|
55
|
+
<% if (post.tags.data.length !== 0) { %>
|
56
56
|
<span class="icon">
|
57
57
|
<i class="fa-solid fa-tags fa-fw"></i>
|
58
58
|
</span>
|
package/layout/script.ejs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<script src="<%- url_for("/js/functions.js") %>"></script>
|
2
2
|
<script src="<%- url_for("/js/particlex.js") %>"></script>
|
3
|
-
<% if (type
|
3
|
+
<% if (type === "post" && page.comments) { %>
|
4
4
|
<% if (theme.gitalk.enable) { %>
|
5
5
|
<script src="https://cdn.staticfile.org/gitalk/1.8.0/gitalk.min.js"></script>
|
6
6
|
<link rel="stylesheet" href="https://cdn.staticfile.org/gitalk/1.8.0/gitalk.min.css">
|
@@ -8,7 +8,7 @@
|
|
8
8
|
let clientID = "<%- theme.gitalk.clientID %>",
|
9
9
|
clientSecret = "<%- theme.gitalk.clientSecret %>";
|
10
10
|
<% Object.keys(theme.gitalk.sites).forEach(key => { %>
|
11
|
-
if (window.location.host
|
11
|
+
if (window.location.host === "<%- key %>") {
|
12
12
|
clientID = "<%- theme.gitalk.sites[key].clientID %>";
|
13
13
|
clientSecret = "<%- theme.gitalk.sites[key].clientSecret %>";
|
14
14
|
}
|
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
|
36
|
+
<% if (post.categories && post.categories.data.length !== 0){ %>
|
37
37
|
<span class="category">
|
38
38
|
<a href="<%- url_for(post.categories.data[0].path) %>">
|
39
39
|
<span class="icon">
|
@@ -43,7 +43,7 @@
|
|
43
43
|
</a>
|
44
44
|
</span>
|
45
45
|
<% } %>
|
46
|
-
<% if (post.tags && post.tags.data.length
|
46
|
+
<% if (post.tags && post.tags.data.length !== 0) { %>
|
47
47
|
<span class="tags">
|
48
48
|
<span class="icon">
|
49
49
|
<i class="fa-solid fa-tags fa-fw"></i>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-particlex",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.4.1",
|
4
4
|
"description": "A concise Hexo theme, based on Particle.",
|
5
5
|
"scripts": {
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
@@ -24,7 +24,7 @@
|
|
24
24
|
},
|
25
25
|
"homepage": "https://github.com/argvchs/hexo-theme-particlex#readme",
|
26
26
|
"dependencies": {
|
27
|
-
"hexo-helper-crypto": "^1.0.
|
27
|
+
"hexo-helper-crypto": "^1.0.6",
|
28
28
|
"hexo-renderer-ejs": "^2.0.0"
|
29
29
|
}
|
30
30
|
}
|