hexo-theme-solitude 1.12.3 → 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/persona.avif +0 -0
- package/.github/screenshot.avif +0 -0
- package/README.md +3 -3
- package/README_en-US.md +3 -3
- package/README_zh-Hant.md +3 -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/includes/console.pug +39 -26
- package/layout/includes/head/config.pug +20 -0
- package/layout/includes/header.pug +4 -2
- package/layout/includes/layout.pug +6 -1
- package/layout/includes/page/recentcomment.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/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/index.pug +2 -0
- package/layout/post.pug +6 -3
- package/package.json +1 -1
- package/scripts/event/merge_config.js +34 -1
- package/scripts/filter/checkThemeConfig.js +0 -5
- package/source/css/_comments/comment.styl +3 -4
- package/source/css/_global/index.styl +18 -2
- 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 +14 -13
- package/source/css/_page/_home/home-top.styl +6 -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 +2 -5
- package/source/css/_post/relatedPost.styl +1 -1
- package/source/css/_post/tools.styl +1 -1
- package/source/js/main.js +63 -15
- package/.github/logo.svg +0 -23
- package/.github/screenshot.webp +0 -0
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
|
|
@@ -31,11 +31,11 @@
|
|
31
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
32
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
33
33
|
|
34
|
-
[文档](https://solitude.js.org/)丨[预览](https://
|
34
|
+
[文档](https://solitude.js.org/)丨[预览](https://everfu.github.io/Solitude/)
|
35
35
|
|
36
36
|
</div>
|
37
37
|
|
38
|
-

|
39
39
|
|
40
40
|
## 特性
|
41
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
|
|
@@ -31,11 +31,11 @@
|
|
31
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
32
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
33
33
|
|
34
|
-
[Documentation](https://solitude.js.org/)丨[Preview](https://
|
34
|
+
[Documentation](https://solitude.js.org/)丨[Preview](https://everfu.github.io/Solitude/)
|
35
35
|
|
36
36
|
</div>
|
37
37
|
|
38
|
-

|
39
39
|
|
40
40
|
## Features
|
41
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
|
|
@@ -31,11 +31,11 @@
|
|
31
31
|
[](https://gitee.com/nsjjd_w/hexo-theme-solitude)
|
32
32
|
[](https://gitlab.com/efu/hexo-theme-solitude)
|
33
33
|
|
34
|
-
[文档](https://solitude.js.org/)丨[預覽](https://
|
34
|
+
[文档](https://solitude.js.org/)丨[預覽](https://everfu.github.io/Solitude/)
|
35
35
|
|
36
36
|
</div>
|
37
37
|
|
38
|
-

|
39
39
|
|
40
40
|
## 特性
|
41
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
@@ -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
|
@@ -132,6 +132,24 @@
|
|
132
132
|
}
|
133
133
|
}
|
134
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
|
+
|
135
153
|
script.
|
136
154
|
const GLOBAL_CONFIG = {
|
137
155
|
root: '!{config.root}',
|
@@ -167,4 +185,6 @@ script.
|
|
167
185
|
lightbox: '!{ theme.mediumZoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null")}',
|
168
186
|
post_ai: !{post_ai},
|
169
187
|
right_menu: !{rightMenu ? JSON.stringify(rightMenu) : false},
|
188
|
+
lure: !{lure ? JSON.stringify(lure) : false},
|
189
|
+
expire: !{expire ? JSON.stringify(expire) : false},
|
170
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
|
@@ -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
|
@@ -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
|
+
}
|
@@ -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
|
|
@@ -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 = /:[a-z0-9_\u4e00-\u9fa5]+:/g
|
7
7
|
let cache = utils.saveToLocal.get('valine-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 = []
|
@@ -42,7 +42,7 @@ script(pjax).
|
|
42
42
|
content: formatContent(i.comment)
|
43
43
|
})
|
44
44
|
}
|
45
|
-
setHtml(document.querySelector('#
|
45
|
+
setHtml(document.querySelector('#console_recentcomments'), ls)
|
46
46
|
utils.saveToLocal.set('valine-recent-comments', ls, !{cache})
|
47
47
|
})
|
48
48
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
script(pjax).
|
2
2
|
(async () => {
|
3
|
-
document.querySelector('#
|
3
|
+
document.querySelector('#console_recentcomments').textContent = `#{__("loading")}`
|
4
4
|
const emojiReg = /<img [^>]+ class="wl-emoji">/g
|
5
5
|
let cache = utils.saveToLocal.get('waline-recent-comments')
|
6
6
|
if (cache) {
|
7
|
-
setHtml(document.querySelector('#
|
7
|
+
setHtml(document.querySelector('#console_recentcomments'), cache)
|
8
8
|
return
|
9
9
|
}
|
10
10
|
let ls = []
|
@@ -34,7 +34,7 @@ script(pjax).
|
|
34
34
|
content: formatContent(i.comment)
|
35
35
|
})
|
36
36
|
}
|
37
|
-
setHtml(document.querySelector('#
|
37
|
+
setHtml(document.querySelector('#console_recentcomments'), ls)
|
38
38
|
utils.saveToLocal.set('waline-recent-comments', ls, !{cache})
|
39
39
|
})
|
40
40
|
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#post-info
|
2
|
+
#post-firstinfo
|
3
|
+
.meta-firstline
|
4
|
+
- var cc = page.reprint ? _p('post.reprint') : _p('post.original')
|
5
|
+
a.post-meta-original(title=_p('post.cc').replace(/\$\{cc}/, cc))= cc
|
6
|
+
if page.categories.data.length > 0
|
7
|
+
span.post-meta-categories
|
8
|
+
a.post-meta-categories(href=url_for('/' + page.categories.data[0].path))= page.categories.data[0].name
|
9
|
+
.tag_share
|
10
|
+
.post-meta__tag-list
|
11
|
+
each tag in page.tags.data
|
12
|
+
a.post-meta__tags(href=url_for(tag.path))
|
13
|
+
span.tags-name.tags-punctuation= tag.name
|
14
|
+
h1.post-title= page.title
|
15
|
+
#post-meta
|
16
|
+
.meta-secondline
|
17
|
+
if theme.post.meta.date
|
18
|
+
span.post-meta-date(title=_p('post.posted') + ' ' + full_date(page.date))
|
19
|
+
i.post-meta-icon.solitude.st-calendar-todo-fill
|
20
|
+
time(datetime=date_xml(page.date))= date_xml(page.date)
|
21
|
+
if theme.post.meta.updated
|
22
|
+
span.post-meta-date(title=_p('post.updated') + ' ' + full_date(page.updated))
|
23
|
+
i.post-meta-icon.solitude.st-refresh-line
|
24
|
+
time(datetime=date_xml(page.updated))= date_xml(page.updated)
|
25
|
+
if theme.wordcount
|
26
|
+
span.post-meta-wordcount
|
27
|
+
if theme.post.meta.wordcount
|
28
|
+
i.post-meta-icon.solitude.st-word-fill(title=_p('post.wordcount'))
|
29
|
+
span.word-count= wordcount(page.content)
|
30
|
+
span.post-meta-separator
|
31
|
+
if theme.post.meta.readtime
|
32
|
+
i.post-meta-icon.solitude.st-clock-fill(title=_p('post.minread'))
|
33
|
+
span= min2read(page.content) + " min"
|
34
|
+
if theme.post.meta.locate
|
35
|
+
span.post-meta-position(title=_p('post.ip') + page.locate)
|
36
|
+
i.post-meta-icon.solitude.st-map-pin-fill
|
37
|
+
span= page.locate
|
38
|
+
if theme.post.meta.pv
|
39
|
+
a.post-meta-pv(href=url_for(page.path), title=_p('post.pv'))
|
40
|
+
i.post-meta-icon.solitude.st-fire-fill
|
41
|
+
if theme.comment.use && theme.comment.pv
|
42
|
+
case theme.comment.use[0]
|
43
|
+
when "Twikoo"
|
44
|
+
span#twikoo_visitors
|
45
|
+
i.solitude.st-loading-line
|
46
|
+
when "Waline"
|
47
|
+
span.waline-pageview-count
|
48
|
+
i.solitude.st-loading-line
|
49
|
+
when "Valine"
|
50
|
+
span.leancloud_visitors(id=url_for(page.path))
|
51
|
+
span.leancloud-visitors-count
|
52
|
+
i.solitude.st-loading-line
|
53
|
+
when 'Artalk'
|
54
|
+
span#ArtalkPV
|
55
|
+
i.solitude.st-loading-line
|
56
|
+
else
|
57
|
+
if theme.busuanzi
|
58
|
+
if theme.busuanzi_use === 0
|
59
|
+
span#busuanzi_value_page_pv
|
60
|
+
i.solitude.st-loading-line
|
61
|
+
else
|
62
|
+
span#busuanzi_page_pv
|
63
|
+
i.solitude.st-loading-line
|
64
|
+
if theme.post.meta.comment && page.comment && theme.comment.count && theme.comment.use
|
65
|
+
span.post-meta-commentcount(title=_p('post.comment'), onclick="sco.scrollTo('post-comment')")
|
66
|
+
i.solitude.st-chat-fill
|
67
|
+
a(href=url_for(page.path) + "#post-comment")
|
68
|
+
case theme.comment.use[0]
|
69
|
+
when "Twikoo"
|
70
|
+
span.twikoo-count
|
71
|
+
i.solitude.st-loading-line
|
72
|
+
when "Waline"
|
73
|
+
span.waline-comment-count
|
74
|
+
i.solitude.st-loading-line
|
75
|
+
when "Valine"
|
76
|
+
span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
77
|
+
i.solitude.st-loading-line
|
78
|
+
when 'Artalk'
|
79
|
+
span.artalk-count
|
80
|
+
i.solitude.st-loading-line
|