hexo-theme-solitude 1.12.2 → 1.13.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/.github/FUNDING.yml +3 -2
- package/.github/persona.avif +0 -0
- package/.github/screenshot.avif +0 -0
- package/README.md +5 -3
- package/README_en-US.md +5 -3
- package/README_zh-Hant.md +5 -3
- package/_config.yml +52 -8
- package/languages/default.yml +1 -0
- package/languages/en.yml +1 -0
- package/languages/zh-CN.yml +1 -0
- package/languages/zh-TW.yml +1 -0
- package/layout/404.pug +1 -1
- package/layout/includes/console.pug +39 -26
- package/layout/includes/head/config.pug +31 -7
- package/layout/includes/header.pug +4 -2
- package/layout/includes/inject/head.pug +4 -6
- package/layout/includes/layout.pug +6 -1
- package/layout/includes/mixins/articleSort.pug +1 -1
- package/layout/includes/page/recentcomment.pug +1 -1
- package/layout/includes/widgets/aside/asideNewestPost.pug +1 -1
- package/layout/includes/widgets/home/banner.pug +15 -12
- package/layout/includes/widgets/home/hot/index.pug +7 -0
- package/layout/includes/widgets/home/hot/twikoo.pug +46 -0
- package/layout/includes/widgets/home/topGroup.pug +1 -1
- package/layout/includes/widgets/nav/right.pug +1 -1
- package/layout/includes/widgets/page/links/banner.pug +2 -1
- package/layout/includes/widgets/page/recentcomment/artalk.pug +3 -3
- package/layout/includes/widgets/page/recentcomment/twikoo.pug +3 -3
- package/layout/includes/widgets/page/recentcomment/valine.pug +3 -3
- package/layout/includes/widgets/page/recentcomment/waline.pug +3 -3
- package/layout/includes/widgets/post/postInfo.pug +80 -0
- package/layout/includes/widgets/post/postMeta.pug +1 -81
- package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -1
- package/layout/index.pug +2 -0
- package/layout/post.pug +6 -3
- package/package.json +3 -3
- package/plugins.yml +6 -6
- package/scripts/event/merge_config.js +34 -1
- package/scripts/filter/checkThemeConfig.js +0 -5
- package/scripts/helper/inject_head_js.js +5 -0
- package/source/css/_comments/comment.styl +3 -4
- package/source/css/_global/index.styl +19 -6
- package/source/css/_highlight/highlight/index.styl +2 -1
- package/source/css/_highlight/index.styl +3 -3
- package/source/css/_highlight/prismjs/index.styl +2 -1
- package/source/css/_layout/article-container.styl +4 -0
- package/source/css/_layout/console.styl +1 -1
- package/source/css/_layout/expire.styl +13 -0
- package/source/css/_layout/header.styl +15 -13
- package/source/css/_page/_home/home-top.styl +7 -0
- package/source/css/_page/_home/home.styl +4 -1
- package/source/css/_page/_home/hot-tip.styl +11 -0
- package/source/css/_page/index.styl +1 -1
- package/source/css/_page/links.styl +22 -1
- package/source/css/_page/other.styl +2 -0
- package/source/css/_page/recentcomment.styl +5 -2
- package/source/css/_post/copyright.styl +1 -1
- package/source/css/_post/meta.styl +196 -187
- package/source/css/_post/pagination.styl +12 -8
- package/source/css/_post/relatedPost.styl +1 -1
- package/source/css/_post/tools.styl +1 -1
- package/source/js/main.js +63 -15
- package/source/js/music.js +1 -1
- package/source/js/right_menu.js +9 -11
- package/.github/logo.svg +0 -23
- package/.github/screenshot.webp +0 -0
package/.github/FUNDING.yml
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# These are supported funding model platforms
|
2
2
|
|
3
|
-
github:
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
4
|
patreon: everfu # Replace with a single Patreon username
|
5
|
+
polar: everfu
|
5
6
|
open_collective: # Replace with a single Open Collective username
|
6
7
|
ko_fi: # Replace with a single Ko-fi username
|
7
8
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
@@ -10,4 +11,4 @@ liberapay: # Replace with a single Liberapay username
|
|
10
11
|
issuehunt: # Replace with a single IssueHunt username
|
11
12
|
otechie: # Replace with a single Otechie username
|
12
13
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
13
|
-
custom: [
|
14
|
+
custom: [https://afdian.net/a/everfu] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
Binary file
|
Binary file
|
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
<img src=".github/
|
5
|
+
<img src=".github/persona.avif" alt="Solitude logo" height="200">
|
6
6
|
|
7
7
|
<h1>Hexo Theme Solitude</h1>
|
8
8
|
|
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
主题设计由 [@张洪Heo](https://github.com/zhheo) 全权授权
|
12
12
|
|
13
|
+
<a href="https://polar.sh/everfu"><img src="https://polar.sh/embed/seeks-funding-shield.svg?org=everfu" /></a>
|
14
|
+
|
13
15
|

|
14
16
|

|
15
17
|

|
@@ -29,11 +31,11 @@
|
|
29
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
30
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
31
33
|
|
32
|
-
[文档](https://solitude.js.org/)丨[预览](https://
|
34
|
+
[文档](https://solitude.js.org/)丨[预览](https://everfu.github.io/Solitude/)
|
33
35
|
|
34
36
|
</div>
|
35
37
|
|
36
|
-

|
37
39
|
|
38
40
|
## 特性
|
39
41
|
|
package/README_en-US.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
<img src=".github/
|
5
|
+
<img src=".github/persona.avif" alt="Solitude logo" height="200">
|
6
6
|
|
7
7
|
<h1>Hexo Theme Solitude</h1>
|
8
8
|
|
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
Theme design is fully licensed by [@张洪Heo](https://github.com/zhheo).
|
12
12
|
|
13
|
+
<a href="https://polar.sh/everfu"><img src="https://polar.sh/embed/seeks-funding-shield.svg?org=everfu" /></a>
|
14
|
+
|
13
15
|

|
14
16
|

|
15
17
|

|
@@ -29,11 +31,11 @@
|
|
29
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
30
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
31
33
|
|
32
|
-
[Documentation](https://solitude.js.org/)丨[Preview](https://
|
34
|
+
[Documentation](https://solitude.js.org/)丨[Preview](https://everfu.github.io/Solitude/)
|
33
35
|
|
34
36
|
</div>
|
35
37
|
|
36
|
-

|
37
39
|
|
38
40
|
## Features
|
39
41
|
|
package/README_zh-Hant.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
<img src=".github/
|
5
|
+
<img src=".github/persona.avif" alt="Solitude logo" height="200">
|
6
6
|
|
7
7
|
<h1>Hexo Theme Solitude</h1>
|
8
8
|
|
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
主題設計由 [@张洪Heo](https://github.com/zhheo)全權授權
|
12
12
|
|
13
|
+
<a href="https://polar.sh/everfu"><img src="https://polar.sh/embed/seeks-funding-shield.svg?org=everfu" /></a>
|
14
|
+
|
13
15
|

|
14
16
|

|
15
17
|

|
@@ -29,11 +31,11 @@
|
|
29
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
30
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
31
33
|
|
32
|
-
[文档](https://solitude.js.org/)丨[預覽](https://
|
34
|
+
[文档](https://solitude.js.org/)丨[預覽](https://everfu.github.io/Solitude/)
|
33
35
|
|
34
36
|
</div>
|
35
37
|
|
36
|
-

|
37
39
|
|
38
40
|
## 特性
|
39
41
|
|
package/_config.yml
CHANGED
@@ -329,6 +329,7 @@ page:
|
|
329
329
|
# post default settings
|
330
330
|
post:
|
331
331
|
default:
|
332
|
+
top_cover: true # 顶部描述 / Top description
|
332
333
|
# 文章默认图片
|
333
334
|
# default cover
|
334
335
|
cover:
|
@@ -760,7 +761,7 @@ post_ai:
|
|
760
761
|
|
761
762
|
# latex 公式支持
|
762
763
|
# latex formula support
|
763
|
-
# docs: https://solitude.js.org/
|
764
|
+
# docs: https://solitude.js.org/config/extend.html#数学公式
|
764
765
|
katex:
|
765
766
|
enable: false
|
766
767
|
per_page: false # 是否在每页都加载 / Whether to load on each page
|
@@ -776,6 +777,9 @@ comment:
|
|
776
777
|
count: false # 评论数展示
|
777
778
|
pv: false # 是否使用評論統計頁面訪問
|
778
779
|
avatar: https://cravatar.cn # Gravatar link
|
780
|
+
hot_tip: # 多人互动
|
781
|
+
enable: false # 开启后将在文章列表显示多人互动
|
782
|
+
count: 3 # 设置大于多少评论时显示
|
779
783
|
|
780
784
|
# twikoo 配置信息
|
781
785
|
# twikoo settings
|
@@ -822,8 +826,15 @@ giscus:
|
|
822
826
|
dark: dark
|
823
827
|
option:
|
824
828
|
|
825
|
-
#
|
826
|
-
|
829
|
+
# 中控台
|
830
|
+
console:
|
831
|
+
enable: false # 开启后显示中控台
|
832
|
+
recentComment: # 开启后显示最近评论
|
833
|
+
enable: false # 开启前请先配置评论
|
834
|
+
storage: .2 # 缓存时间
|
835
|
+
card:
|
836
|
+
tags: true # 开启后显示 标签
|
837
|
+
archive: true # 开启后显示 归档
|
827
838
|
|
828
839
|
# 站点验证
|
829
840
|
# Site verification
|
@@ -862,7 +873,7 @@ extends:
|
|
862
873
|
|
863
874
|
# PWA
|
864
875
|
# https://developer.mozilla.org/zh-CN/docs/Web/Progressive_web_apps
|
865
|
-
# docs: https://solitude.js.org/
|
876
|
+
# docs: https://solitude.js.org/config/extra#pwa
|
866
877
|
pwa:
|
867
878
|
enable: false
|
868
879
|
manifest: /manifest.json # manifest.json 文件路径
|
@@ -931,11 +942,43 @@ memorial:
|
|
931
942
|
enable: false
|
932
943
|
# 日期, (M-D)
|
933
944
|
# Date, (M-D)
|
934
|
-
# eg: 7-
|
945
|
+
# eg: 7-7, 9-18, 12-13 ...
|
935
946
|
date:
|
936
|
-
- "7-
|
937
|
-
- "9-18"
|
938
|
-
- "12-13"
|
947
|
+
- "7-7" # 七七事变
|
948
|
+
- "9-18" # 九一八事变/建军节
|
949
|
+
- "12-13" # 南京国家公祭日
|
950
|
+
|
951
|
+
# 诱骗
|
952
|
+
# lure
|
953
|
+
lure:
|
954
|
+
enable: false
|
955
|
+
# 跳出
|
956
|
+
# Jump out
|
957
|
+
jump: "404 Not Found"
|
958
|
+
# 切回
|
959
|
+
# Switch back
|
960
|
+
back: "ヾ(≧∇≦*)ゝ嘿嘿,上当了吧"
|
961
|
+
|
962
|
+
# 文章过期提醒
|
963
|
+
# Article expiration reminder
|
964
|
+
expire:
|
965
|
+
enable: false
|
966
|
+
# 过期时间
|
967
|
+
# Expiration time
|
968
|
+
time: 30
|
969
|
+
position: top # top / bottom
|
970
|
+
# 过期提示
|
971
|
+
# Expiration prompt
|
972
|
+
text_prev: "本文已于"
|
973
|
+
text_next: "天前过期,如果内容不符,请联系站长更新。"
|
974
|
+
|
975
|
+
# 背景图片
|
976
|
+
# Background image
|
977
|
+
background:
|
978
|
+
enable: false
|
979
|
+
opacity: .2
|
980
|
+
dark: https://bu.dusays.com/2023/09/29/651685ce667d1.jpg
|
981
|
+
light: https://bu.dusays.com/2023/09/29/651685cc18d39.jpg
|
939
982
|
|
940
983
|
# CDN
|
941
984
|
# Don't modify the following settings unless you know how they work
|
@@ -958,6 +1001,7 @@ CDN:
|
|
958
1001
|
|
959
1002
|
option:
|
960
1003
|
solitude_css: https://cdn2.codesign.qq.com/icons/7pOrz0WXB5ZWJPX/latest/iconfont.css
|
1004
|
+
busuanzi_qj_js: https://pv.lemonso.com/js
|
961
1005
|
# algolia_search:
|
962
1006
|
# instantsearch:
|
963
1007
|
# pjax:
|
package/languages/default.yml
CHANGED
package/languages/en.yml
CHANGED
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
package/layout/404.pug
CHANGED
@@ -19,6 +19,6 @@ block content
|
|
19
19
|
break
|
20
20
|
.aside-list-item
|
21
21
|
a.thumbnail(href=url_for(post.path), title=post.title)
|
22
|
-
img(src=post.cover, alt=post.title)
|
22
|
+
img(src=url_for(post.cover), alt=post.title)
|
23
23
|
.content
|
24
24
|
a.title(href=url_for(post.path), title=post.title)= post.title
|
@@ -1,33 +1,46 @@
|
|
1
|
+
- const { recentComment, card } = theme.console
|
2
|
+
- const { cache } = recentComment
|
3
|
+
- const limit = 6
|
4
|
+
- const { use } = theme.comment
|
5
|
+
|
1
6
|
div#console
|
2
7
|
div.close-btn(onclick="sco.hideConsole()")
|
3
8
|
i.solitude.st-close-fill
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
div.console-card-
|
8
|
-
div.console-card#card-newest-comments(onclick="sco.hideConsole()")
|
9
|
-
div.card-content
|
10
|
-
div.author-content-item-tips= _p('console.comment_tip')
|
11
|
-
div.author-content-item-title
|
12
|
-
| #{_p('console.comment_title')}
|
13
|
-
if theme.recent_comments.enable
|
14
|
-
a.recent-comment-more(href=url_for(theme.recent_comments.page) title=_p('console.recent_comment_more'))
|
15
|
-
i.solitude.st-right-btn-fill
|
16
|
-
a.recent-comment-image(href=url_for(theme.recent_comments.page))
|
17
|
-
img(src=theme.recent_comments.img)
|
18
|
-
|
19
|
-
div.console-card-group-right
|
20
|
-
div.console-card.tags(onclick="sco.hideConsole()")
|
9
|
+
div.console-card-group
|
10
|
+
if use && recentComment.enable
|
11
|
+
div.console-card-group-left
|
12
|
+
div.console-card#card-newest-comments(onclick="sco.hideConsole()")
|
21
13
|
div.card-content
|
22
|
-
div.author-content-item-tips= _p('console.
|
23
|
-
div.author-content-item-title
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
14
|
+
div.author-content-item-tips= _p('console.comment_tip')
|
15
|
+
div.author-content-item-title
|
16
|
+
| #{_p('console.comment_title')}
|
17
|
+
if theme.recent_comments.enable
|
18
|
+
a.recent-comment-more(href=url_for(theme.recent_comments.page) title=_p('console.recent_comment_more'))
|
19
|
+
i.solitude.st-right-btn-fill
|
20
|
+
#console_recentcomments
|
21
|
+
case use[0]
|
22
|
+
when 'Twikoo'
|
23
|
+
include ./widgets/page/recentcomment/twikoo
|
24
|
+
when 'Valine'
|
25
|
+
include ./widgets/page/recentcomment/valine
|
26
|
+
when 'Waline'
|
27
|
+
include ./widgets/page/recentcomment/waline
|
28
|
+
when 'Artalk'
|
29
|
+
include ./widgets/page/recentcomment/artalk
|
30
|
+
if card.tags || card.archive
|
31
|
+
div.console-card-group-right
|
32
|
+
if card.tags
|
33
|
+
div.console-card.tags(onclick="sco.hideConsole()")
|
34
|
+
div.card-content
|
35
|
+
div.author-content-item-tips= _p('console.tag_tip')
|
36
|
+
div.author-content-item-title= _p('console.tag_title')
|
37
|
+
div.card-tag-cloud
|
38
|
+
each tag in site.tags.find({ parent: { $exists: false } }).data
|
39
|
+
a(href=url_for(tag.path))= tag.name
|
40
|
+
sup= tag.length
|
41
|
+
if card.archive
|
42
|
+
div.console-card.history(onclick="sco.hideConsole()")
|
43
|
+
include ./widgets/aside/asideArchive.pug
|
31
44
|
|
32
45
|
div.button-group
|
33
46
|
div.console-btn-item
|
@@ -122,6 +122,34 @@
|
|
122
122
|
}
|
123
123
|
}
|
124
124
|
|
125
|
+
let highlight = false
|
126
|
+
if (theme.highlight.enable) {
|
127
|
+
highlight = {
|
128
|
+
limit: theme.highlight.limit,
|
129
|
+
expand: theme.highlight.expand,
|
130
|
+
copy: theme.highlight.copy,
|
131
|
+
syntax: config.syntax_highlighter
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
let lure = false
|
136
|
+
if (theme.lure.enable) {
|
137
|
+
lure = {
|
138
|
+
jump: theme.lure.jump,
|
139
|
+
back: theme.lure.back,
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
let expire = false
|
144
|
+
if (theme.expire.enable) {
|
145
|
+
expire = {
|
146
|
+
time: theme.expire.time,
|
147
|
+
position: theme.expire.position,
|
148
|
+
text_prev: theme.expire.text_prev,
|
149
|
+
text_next: theme.expire.text_next,
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
125
153
|
script.
|
126
154
|
const GLOBAL_CONFIG = {
|
127
155
|
root: '!{config.root}',
|
@@ -133,13 +161,7 @@ script.
|
|
133
161
|
error: '!{theme.lazyload.errorimg}'
|
134
162
|
},
|
135
163
|
copyright: !{copyright},
|
136
|
-
highlight: {
|
137
|
-
enable: !{theme.highlight.enable},
|
138
|
-
limit: !{theme.highlight.limit},
|
139
|
-
expand: !{theme.highlight.expand},
|
140
|
-
copy: !{theme.highlight.copy},
|
141
|
-
syntax: '!{config.syntax_highlighter}'
|
142
|
-
},
|
164
|
+
highlight: !{highlight ? JSON.stringify(highlight) : false},
|
143
165
|
randomlink: !{theme.footer.randomlink},
|
144
166
|
lang: !{JSON.stringify(lang)},
|
145
167
|
aside: {
|
@@ -163,4 +185,6 @@ script.
|
|
163
185
|
lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
|
164
186
|
post_ai: !{post_ai},
|
165
187
|
right_menu: !{rightMenu ? JSON.stringify(rightMenu) : false},
|
188
|
+
lure: !{lure ? JSON.stringify(lure) : false},
|
189
|
+
expire: !{expire ? JSON.stringify(expire) : false},
|
166
190
|
};
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
- const not_cover = !(typeof page.not_cover ==='undefined' ? false : page.not_cover)
|
2
|
+
header#page-header(class=is_post() && theme.post.default.top_cover && not_cover ? 'post-bg' : 'not-top-img')
|
2
3
|
include ./nav.pug
|
3
4
|
if is_post()
|
4
|
-
|
5
|
+
if theme.post.default.top_cover && !page.not_cover
|
6
|
+
include ./widgets/post/postMeta.pug
|
@@ -27,12 +27,10 @@ include ../head/opengraph.pug
|
|
27
27
|
include ../head/pwa.pug
|
28
28
|
|
29
29
|
script.
|
30
|
-
console.log(
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
|
35
|
-
)
|
30
|
+
console.log(' %c Solitude %c ' + '!{packageVersion()}' + ' %c https://github.com/everfu/hexo-theme-solitude',
|
31
|
+
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
|
32
|
+
'background:#ff9a9a ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
|
33
|
+
'background:unset ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff')
|
36
34
|
|
37
35
|
if theme.memorial.enable
|
38
36
|
script.
|
@@ -9,12 +9,17 @@ html(lang=config.language, data-theme="light")
|
|
9
9
|
if theme.display_mode.universe
|
10
10
|
canvas#universe
|
11
11
|
|
12
|
+
// background img
|
13
|
+
if theme.background.enable
|
14
|
+
#global_bg
|
15
|
+
|
12
16
|
// loading
|
13
17
|
if theme.loading.fullpage
|
14
18
|
include ./loading.pug
|
15
19
|
|
16
20
|
// console
|
17
|
-
|
21
|
+
if theme.console.enable
|
22
|
+
include ./console.pug
|
18
23
|
|
19
24
|
// sidebar
|
20
25
|
include ./sidebar.pug
|
@@ -5,7 +5,7 @@ each post in page.posts.find({ parent: { $exists: false } }).data
|
|
5
5
|
.article-sort-item.year #{year}
|
6
6
|
.article-sort-item
|
7
7
|
a.article-sort-item-img(href=url_for(post.path) title=post.title)
|
8
|
-
img(src=post.cover alt=post.title)
|
8
|
+
img(src=url_for(post.cover) alt=post.title)
|
9
9
|
.article-sort-item-info
|
10
10
|
a.article-sort-item-title(href=url_for(post.path) title=post.title onclick="window.event.cancelBubble=true;") #{post.title}
|
11
11
|
.article-sort-item-tags
|
@@ -8,7 +8,7 @@
|
|
8
8
|
if index <= 5
|
9
9
|
.aside-list-item
|
10
10
|
a.thumbnail(href=url_for(post.path) title=post.title)
|
11
|
-
img(alt=post.title src=post.cover)
|
11
|
+
img(alt=post.title src=url_for(post.cover))
|
12
12
|
.content
|
13
13
|
a.title(href=url_for(post.path) title=post.title)= post.title
|
14
14
|
if post.categories.data[0]
|
@@ -1,6 +1,8 @@
|
|
1
|
+
- const { title, url, icon} = theme.hometop.banner
|
2
|
+
|
1
3
|
div.banners-title
|
2
|
-
div.banners-title-big!=
|
3
|
-
div.banners-title-small=
|
4
|
+
div.banners-title-big!= title
|
5
|
+
div.banners-title-small= url
|
4
6
|
- var group = theme.hometop.group
|
5
7
|
if group
|
6
8
|
div.banners-links
|
@@ -11,13 +13,14 @@ if group
|
|
11
13
|
i.solitude(class=array[1])
|
12
14
|
.banners-link-title= label
|
13
15
|
|
14
|
-
|
15
|
-
.tags-group-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
if icon
|
17
|
+
div.tags-group-all
|
18
|
+
.tags-group-wrapper
|
19
|
+
each i in [1,2]
|
20
|
+
- var keys = Object.keys(icon)
|
21
|
+
- var pairs = keys.map((val, i) => i % 2 ? [keys[i - 1], val] : []).filter(x => x.length)
|
22
|
+
each pair in pairs
|
23
|
+
.tags-group-icon-pair
|
24
|
+
each key in pair
|
25
|
+
.tags-group-icon(style=`background: ${icon[key].color}`)
|
26
|
+
img.nolazyload(src=icon[key].img, title=key)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
script.
|
2
|
+
function updatePostsBasedOnComments() {
|
3
|
+
const location = window.location
|
4
|
+
const posts = Array.from(document.querySelectorAll('.recent-post-item[onclick] .post_cover a')).map(item => item.href.replace(location, '/'))
|
5
|
+
|
6
|
+
function get() {
|
7
|
+
twikoo.getCommentsCount({
|
8
|
+
envId: "!{theme.twikoo.envId}",
|
9
|
+
urls: posts,
|
10
|
+
includeReply: true
|
11
|
+
}).then(function (response) {
|
12
|
+
response.forEach(function (comment) {
|
13
|
+
if (comment.count > !{count}) {
|
14
|
+
const postElement = document.querySelector(`.recent-post-item[onclick*="${comment.url}"]`);
|
15
|
+
if (postElement) {
|
16
|
+
const infoTopTips = postElement.querySelector(".recent-post-info-top-tips"),
|
17
|
+
originalSpan = infoTopTips ? infoTopTips.querySelector(".original") : null;
|
18
|
+
if (originalSpan) {
|
19
|
+
const hotTip = createHotTipElement();
|
20
|
+
infoTopTips.insertBefore(hotTip, originalSpan);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
}).catch(function (error) {
|
26
|
+
console.error("Error fetching comments:", error);
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
function createHotTipElement() {
|
31
|
+
const hotTip = document.createElement("span");
|
32
|
+
hotTip.classList.add("hot-tip");
|
33
|
+
|
34
|
+
const icon = document.createElement("i");
|
35
|
+
icon.classList.add("solitude", "st-fire-fill");
|
36
|
+
hotTip.appendChild(icon);
|
37
|
+
|
38
|
+
const commentCount = document.createTextNode("!{_p('hot-tip')}");
|
39
|
+
hotTip.appendChild(commentCount);
|
40
|
+
|
41
|
+
return hotTip;
|
42
|
+
}
|
43
|
+
|
44
|
+
if (typeof twikoo === 'object') get()
|
45
|
+
else utils.getScript('!{url_for(theme.cdn.twikoo)}').then(get)
|
46
|
+
}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.post_cover
|
6
6
|
a(href=url_for(post.path), title=post.title)
|
7
7
|
span.recent-post-top-text= _p('home.recommend')
|
8
|
-
img.post_bg(alt=post.title, src=post.cover)
|
8
|
+
img.post_bg(alt=post.title, src=url_for(post.cover))
|
9
9
|
.recent-post-info
|
10
10
|
a.article-title(href=url_for(post.path), title=post.title)= post.title
|
11
11
|
|
@@ -11,7 +11,7 @@ if theme.search.enable
|
|
11
11
|
.nav-button#search-button
|
12
12
|
a.site-page.social-icon.search(href="javascript:void(0);", title=_p('nav.search'))
|
13
13
|
i.solitude.st-search-line
|
14
|
-
if theme.
|
14
|
+
if theme.console.enable
|
15
15
|
.nav-button#nav-console
|
16
16
|
a.console_switchbutton(onclick="sco.showConsole()", title=_p('nav.console'), href="javascript:void(0);")
|
17
17
|
i.solitude.st-dashboard-fill
|
@@ -28,4 +28,5 @@
|
|
28
28
|
.tags-group-icon-pair
|
29
29
|
each y in pair
|
30
30
|
a.tags-group-icon(href=url_for(y.link), title=y.name)
|
31
|
-
img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
|
31
|
+
img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
|
32
|
+
span.tags-group-title=y.name
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
script(pjax).
|
4
4
|
(async () => {
|
5
|
-
document.querySelector('#
|
5
|
+
document.querySelector('#console_recentcomments').textContent = `#{__("loading")}`
|
6
6
|
const emojiReg = /<img [^>]+ atk-emoticon="[^"]+">/g
|
7
7
|
let cache = utils.saveToLocal.get('artalk-recent-comments')
|
8
8
|
if (cache) {
|
9
|
-
setHtml(document.querySelector('#
|
9
|
+
setHtml(document.querySelector('#console_recentcomments'), cache)
|
10
10
|
return
|
11
11
|
}
|
12
12
|
let ls = []
|
@@ -37,7 +37,7 @@ script(pjax).
|
|
37
37
|
content: formatContent(i.content)
|
38
38
|
})
|
39
39
|
}
|
40
|
-
setHtml(document.querySelector('#
|
40
|
+
setHtml(document.querySelector('#console_recentcomments'), ls)
|
41
41
|
utils.saveToLocal.set('artalk-recent-comments', ls, !{cache})
|
42
42
|
})
|
43
43
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
script(pjax).
|
4
4
|
(async () => {
|
5
|
-
document.querySelector('#
|
5
|
+
document.querySelector('#console_recentcomments').textContent = `#{__("loading")}`
|
6
6
|
const emojiReg = /<img class="tk-owo-emotion" [^>]+>/g
|
7
7
|
let cache = utils.saveToLocal.get('twikoo-recent-comments')
|
8
8
|
if (cache) {
|
9
|
-
setHtml(document.querySelector('#
|
9
|
+
setHtml(document.querySelector('#console_recentcomments'), cache)
|
10
10
|
return
|
11
11
|
}
|
12
12
|
let ls = []
|
@@ -44,7 +44,7 @@ script(pjax).
|
|
44
44
|
time: i.created
|
45
45
|
})
|
46
46
|
}
|
47
|
-
setHtml(document.querySelector('#
|
47
|
+
setHtml(document.querySelector('#console_recentcomments'), ls)
|
48
48
|
utils.saveToLocal.set('twikoo-recent-comments', ls, !{cache})
|
49
49
|
});
|
50
50
|
|