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.
Files changed (66) hide show
  1. package/.github/FUNDING.yml +3 -2
  2. package/.github/persona.avif +0 -0
  3. package/.github/screenshot.avif +0 -0
  4. package/README.md +5 -3
  5. package/README_en-US.md +5 -3
  6. package/README_zh-Hant.md +5 -3
  7. package/_config.yml +52 -8
  8. package/languages/default.yml +1 -0
  9. package/languages/en.yml +1 -0
  10. package/languages/zh-CN.yml +1 -0
  11. package/languages/zh-TW.yml +1 -0
  12. package/layout/404.pug +1 -1
  13. package/layout/includes/console.pug +39 -26
  14. package/layout/includes/head/config.pug +31 -7
  15. package/layout/includes/header.pug +4 -2
  16. package/layout/includes/inject/head.pug +4 -6
  17. package/layout/includes/layout.pug +6 -1
  18. package/layout/includes/mixins/articleSort.pug +1 -1
  19. package/layout/includes/page/recentcomment.pug +1 -1
  20. package/layout/includes/widgets/aside/asideNewestPost.pug +1 -1
  21. package/layout/includes/widgets/home/banner.pug +15 -12
  22. package/layout/includes/widgets/home/hot/index.pug +7 -0
  23. package/layout/includes/widgets/home/hot/twikoo.pug +46 -0
  24. package/layout/includes/widgets/home/topGroup.pug +1 -1
  25. package/layout/includes/widgets/nav/right.pug +1 -1
  26. package/layout/includes/widgets/page/links/banner.pug +2 -1
  27. package/layout/includes/widgets/page/recentcomment/artalk.pug +3 -3
  28. package/layout/includes/widgets/page/recentcomment/twikoo.pug +3 -3
  29. package/layout/includes/widgets/page/recentcomment/valine.pug +3 -3
  30. package/layout/includes/widgets/page/recentcomment/waline.pug +3 -3
  31. package/layout/includes/widgets/post/postInfo.pug +80 -0
  32. package/layout/includes/widgets/post/postMeta.pug +1 -81
  33. package/layout/includes/widgets/third-party/comments/twikoo.pug +1 -1
  34. package/layout/index.pug +2 -0
  35. package/layout/post.pug +6 -3
  36. package/package.json +3 -3
  37. package/plugins.yml +6 -6
  38. package/scripts/event/merge_config.js +34 -1
  39. package/scripts/filter/checkThemeConfig.js +0 -5
  40. package/scripts/helper/inject_head_js.js +5 -0
  41. package/source/css/_comments/comment.styl +3 -4
  42. package/source/css/_global/index.styl +19 -6
  43. package/source/css/_highlight/highlight/index.styl +2 -1
  44. package/source/css/_highlight/index.styl +3 -3
  45. package/source/css/_highlight/prismjs/index.styl +2 -1
  46. package/source/css/_layout/article-container.styl +4 -0
  47. package/source/css/_layout/console.styl +1 -1
  48. package/source/css/_layout/expire.styl +13 -0
  49. package/source/css/_layout/header.styl +15 -13
  50. package/source/css/_page/_home/home-top.styl +7 -0
  51. package/source/css/_page/_home/home.styl +4 -1
  52. package/source/css/_page/_home/hot-tip.styl +11 -0
  53. package/source/css/_page/index.styl +1 -1
  54. package/source/css/_page/links.styl +22 -1
  55. package/source/css/_page/other.styl +2 -0
  56. package/source/css/_page/recentcomment.styl +5 -2
  57. package/source/css/_post/copyright.styl +1 -1
  58. package/source/css/_post/meta.styl +196 -187
  59. package/source/css/_post/pagination.styl +12 -8
  60. package/source/css/_post/relatedPost.styl +1 -1
  61. package/source/css/_post/tools.styl +1 -1
  62. package/source/js/main.js +63 -15
  63. package/source/js/music.js +1 -1
  64. package/source/js/right_menu.js +9 -11
  65. package/.github/logo.svg +0 -23
  66. package/.github/screenshot.webp +0 -0
@@ -1,7 +1,8 @@
1
1
  # These are supported funding model platforms
2
2
 
3
- github: [everfu] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
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: ['https://afdian.net/a/everfu', 'https://s3.qjqq.cn/47/66374315ebd08.webp!color', 'https://s3.qjqq.cn/47/663742bac8e52.webp!color'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
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/logo.svg" alt="Solitude logo" height="200">
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
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?logo=npm)
14
16
  ![release](https://img.shields.io/github/package-json/v/valor-x/hexo-theme-solitude/master?color=%231ab1ad&label=release)
15
17
  ![license](https://img.shields.io/github/license/valor-x/hexo-theme-solitude?color=FF5531)
@@ -29,11 +31,11 @@
29
31
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
30
32
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
31
33
 
32
- [文档](https://solitude.js.org/)丨[预览](https://www.efu.me/)
34
+ [文档](https://solitude.js.org/)丨[预览](https://everfu.github.io/Solitude/)
33
35
 
34
36
  </div>
35
37
 
36
- ![Screenshot](.github/screenshot.webp)
38
+ ![Screenshot](.github/screenshot.avif)
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/logo.svg" alt="Solitude logo" height="200">
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
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?logo=npm)
14
16
  ![release](https://img.shields.io/github/package-json/v/valor-x/hexo-theme-solitude/master?color=%231ab1ad&label=release)
15
17
  ![license](https://img.shields.io/github/license/valor-x/hexo-theme-solitude?color=FF5531)
@@ -29,11 +31,11 @@
29
31
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
30
32
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
31
33
 
32
- [Documentation](https://solitude.js.org/)丨[Preview](https://www.efu.me/)
34
+ [Documentation](https://solitude.js.org/)丨[Preview](https://everfu.github.io/Solitude/)
33
35
 
34
36
  </div>
35
37
 
36
- ![Screenshot](.github/screenshot.webp)
38
+ ![Screenshot](.github/screenshot.avif)
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/logo.svg" alt="Solitude logo" height="200">
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
  ![npm package](https://img.shields.io/npm/v/hexo-theme-solitude?logo=npm)
14
16
  ![release](https://img.shields.io/github/package-json/v/valor-x/hexo-theme-solitude/master?color=%231ab1ad&label=release)
15
17
  ![license](https://img.shields.io/github/license/valor-x/hexo-theme-solitude?color=FF5531)
@@ -29,11 +31,11 @@
29
31
  [![gitee](https://img.shields.io/badge/Gitee-red?logo=gitee)](https://gitee.com/nsjjd_w/hexo-theme-solitude)
30
32
  [![gitlab](https://img.shields.io/badge/GitLab-blue?logo=gitlab)](https://gitlab.com/efu/hexo-theme-solitude)
31
33
 
32
- [文档](https://solitude.js.org/)丨[預覽](https://www.efu.me/)
34
+ [文档](https://solitude.js.org/)丨[預覽](https://everfu.github.io/Solitude/)
33
35
 
34
36
  </div>
35
37
 
36
- ![Screenshot](.github/screenshot.webp)
38
+ ![Screenshot](.github/screenshot.avif)
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/configuration/extra#数学公式
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
- console_plus: false
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/configuration/extra#pwa
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-8, 9-18, 12-13 ...
945
+ # eg: 7-7, 9-18, 12-13 ...
935
946
  date:
936
- - "7-8" #七八卢沟桥事变
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:
@@ -5,6 +5,7 @@ upload: 'datetime: '
5
5
  totalk: You don't need to delete blank lines, just type in your comments.
6
6
  loading: Loading...
7
7
  day: ' days'
8
+ hot-tip: Hot
8
9
 
9
10
  theme:
10
11
  dark: Dark
package/languages/en.yml CHANGED
@@ -5,6 +5,7 @@ upload: 'datetime: '
5
5
  totalk: You don't need to delete blank lines, just type in your comments.
6
6
  loading: Loading...
7
7
  day: ' days'
8
+ hot-tip: Hot
8
9
 
9
10
  theme:
10
11
  dark: Dark
@@ -5,6 +5,7 @@ upload: 发布时间:
5
5
  totalk: 无需删除空行,直接输入评论即可
6
6
  loading: 加载中...
7
7
  day: ' 天'
8
+ hot-tip: 多人互动
8
9
 
9
10
  # Language: 简体中文
10
11
  theme:
@@ -5,6 +5,7 @@ upload: 發佈時間:
5
5
  totalk: 無需刪除空行,直接輸入評論即可
6
6
  loading: 加載中...
7
7
  day: ' 天'
8
+ hot-tip: 多人互動
8
9
 
9
10
  # Language: 繁體中文 (台灣)
10
11
  theme:
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
- if theme.console_plus
5
- div.console-card-group
6
- if theme.recent_comments.enable && theme.recent_comments.img
7
- div.console-card-group-left
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.tag_tip')
23
- div.author-content-item-title= _p('console.tag_title')
24
- div.card-tag-cloud
25
- each tag in site.tags.find({ parent: { $exists: false } }).data
26
- a(href=url_for(tag.path))= tag.name
27
- sup= tag.length
28
-
29
- div.console-card.history(onclick="sco.hideConsole()")
30
- include ./widgets/aside/asideArchive.pug
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
- header#page-header(class=is_post() ? 'post-bg' : 'not-top-img')
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
- include ./widgets/post/postMeta.pug
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
- "%c Program: Hexo %c Theme: Solitude %c Version: v1.12.2",
32
- "border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
33
- "padding: 5px 10px;color:white;background:#3e9f50;",
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
- include ./console.pug
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
@@ -4,7 +4,7 @@
4
4
  include ../widgets/page/banner
5
5
 
6
6
  if enable && use
7
- #comments-page
7
+ #console_recentcomments
8
8
  case use[0]
9
9
  when 'Twikoo'
10
10
  include ../widgets/page/recentcomment/twikoo
@@ -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!= theme.hometop.banner.title
3
- div.banners-title-small= theme.hometop.banner.url
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
- div.tags-group-all
15
- .tags-group-wrapper
16
- each i in [1,2]
17
- - var keys = Object.keys(theme.hometop.banner.icon)
18
- - var pairs = keys.map((val, i) => i % 2 ? [keys[i - 1], val] : []).filter(x => x.length)
19
- each pair in pairs
20
- .tags-group-icon-pair
21
- each key in pair
22
- .tags-group-icon(style=`background: ${theme.hometop.banner.icon[key].color}`)
23
- img.nolazyload(src=theme.hometop.banner.icon[key].img, title=key)
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,7 @@
1
+ - const { count } = theme.comment.hot_tip
2
+ - const { use } = theme.comment
3
+
4
+ if use
5
+ case use[0]
6
+ when 'Twikoo'
7
+ include ./twikoo
@@ -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.nav.right.console
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('#comments-page').textContent = `#{__("loading")}`
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('#comments-page'), cache)
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('#comments-page'), ls)
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('#comments-page').textContent = `#{__("loading")}`
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('#comments-page'), cache)
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('#comments-page'), ls)
47
+ setHtml(document.querySelector('#console_recentcomments'), ls)
48
48
  utils.saveToLocal.set('twikoo-recent-comments', ls, !{cache})
49
49
  });
50
50