hexo-theme-solitude 1.11.2 → 1.12.0
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/CONTRIBUTING.md +1 -1
- package/README.md +5 -3
- package/README_en-US.md +11 -11
- package/README_zh-Hant.md +10 -10
- package/SECURITY.md +1 -1
- package/_config.yml +48 -36
- package/languages/default.yml +3 -1
- package/languages/en.yml +3 -1
- package/languages/zh-CN.yml +2 -0
- package/languages/zh-TW.yml +2 -0
- package/layout/includes/console.pug +4 -3
- package/layout/includes/head/config.pug +1 -0
- package/layout/includes/inject/body.pug +0 -3
- package/layout/includes/inject/head.pug +2 -2
- package/layout/includes/widgets/aside/asideNewstComments.pug +9 -0
- package/layout/includes/widgets/aside/asideSwitch.pug +2 -0
- package/layout/includes/widgets/third-party/comments/artalk.pug +1 -1
- package/layout/includes/widgets/third-party/comments/comment.pug +3 -1
- package/layout/includes/widgets/third-party/comments/giscus.pug +60 -0
- package/layout/includes/widgets/third-party/comments/js.pug +3 -1
- package/layout/includes/widgets/third-party/news-comment/artalk.pug +10 -12
- package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +6 -5
- package/layout/includes/widgets/third-party/news-comment/twikoo.pug +9 -9
- package/layout/includes/widgets/third-party/news-comment/valine.pug +8 -7
- package/layout/includes/widgets/third-party/news-comment/waline.pug +8 -7
- package/package.json +3 -3
- package/scripts/event/merge_config.js +17 -16
- package/scripts/event/welcome.js +1 -1
- package/scripts/filter/default.js +2 -2
- package/source/css/_highlight/index.styl +1 -1
- package/source/css/_layout/aside.styl +53 -6
- package/source/css/_layout/console.styl +3 -79
- package/source/css/_page/message.styl +2 -1
- package/source/css/_post/meta.styl +4 -14
- package/source/css/_post/tools.styl +7 -2
- package/source/css/_search/local-search.styl +4 -0
- package/source/img/404.avif +0 -0
- package/source/img/avatar.avif +0 -0
- package/source/img/default.avif +0 -0
- package/source/img/error_load.avif +0 -0
- package/source/img/happy-sticker.avif +0 -0
- package/source/img/loading.avif +0 -0
- package/source/img/recent_c.avif +0 -0
- package/source/js/main.js +15 -12
- package/source/js/utils.js +8 -0
- package/source/img/404.webp +0 -0
- package/source/img/avatar.png +0 -0
- package/source/img/default.png +0 -0
- package/source/img/error_load.webp +0 -0
- package/source/img/happy-sticker.png +0 -0
- package/source/img/loading.gif +0 -0
package/CONTRIBUTING.md
CHANGED
@@ -33,7 +33,7 @@ $ git push
|
|
33
33
|
* 定期使用项目仓库内容更新自己仓库内容。
|
34
34
|
|
35
35
|
```bash
|
36
|
-
$ git remote add upstream https://github.com/
|
36
|
+
$ git remote add upstream https://github.com/everfu/hexo-theme-solitude
|
37
37
|
$ git fetch upstream
|
38
38
|
$ git checkout dev
|
39
39
|
$ git rebase upstream/dev
|
package/README.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|

|
14
14
|

|
15
15
|

|
16
|
-
[](https://github.com/everfu/hexo-theme-solitude/stargazers)
|
17
17
|
[](https://www.npmjs.com/package/hexo-theme-solitude)
|
18
18
|
|
19
19
|

|
@@ -47,7 +47,7 @@
|
|
47
47
|
## 特性
|
48
48
|
|
49
49
|
- 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA)
|
50
|
-
- 评论(Twikoo、Waline、Valine、Artalk),支持双评论
|
50
|
+
- 评论(Twikoo、Waline、Valine、Artalk、Giscus),支持双评论
|
51
51
|
- 昼夜切换(ColorMode)
|
52
52
|
- 灯箱(medium-zoom、fancybox)
|
53
53
|
- 数学公式(Latex)
|
@@ -62,7 +62,7 @@
|
|
62
62
|
- [x] 弹幕留言页
|
63
63
|
- [x] 首页顶部新样式
|
64
64
|
|
65
|
-
> 如有问题请提 [issue](https://github.com/
|
65
|
+
> 如有问题请提 [issue](https://github.com/everfu/hexo-theme-solitude/issues)
|
66
66
|
|
67
67
|
## 应用
|
68
68
|
|
@@ -88,3 +88,5 @@
|
|
88
88
|
## 版权
|
89
89
|
|
90
90
|
[MIT](./LICENSE) License © 2023-至今 [EverFu](https://github.com/efuo)
|
91
|
+
|
92
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
|
package/README_en-US.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|

|
14
14
|

|
15
15
|

|
16
|
-
[](https://github.com/
|
16
|
+
[](https://github.com/everfu/hexo-theme-solitude/stargazers)
|
17
17
|
[](https://www.npmjs.com/package/hexo-theme-solitude)
|
18
18
|
|
19
19
|

|
@@ -46,13 +46,13 @@
|
|
46
46
|
|
47
47
|
## Features
|
48
48
|
|
49
|
-
- Pjax、LazyLoad、PWA
|
50
|
-
- Comments(Twikoo、Waline、Valine、Artalk), Can double comment
|
51
|
-
- ColorMode
|
52
|
-
- Lightbox(medium-zoom、fancybox)
|
53
|
-
- Mathematical formulas(Latex)
|
54
|
-
- Featured pages: Instant Short Article, My Equipment, Online Tools, Music Gallery, Friend Chain Fish Pond, Photo Album Page, Douban Page, Barrage message page
|
55
|
-
- Article features: AI summary, code highlighting
|
49
|
+
- Pjax、LazyLoad、PWA.
|
50
|
+
- Comments(Twikoo、Waline、Valine、Artalk、Giscus), Can double comment.
|
51
|
+
- ColorMode.
|
52
|
+
- Lightbox(medium-zoom、fancybox).
|
53
|
+
- Mathematical formulas(Latex).
|
54
|
+
- Featured pages: Instant Short Article, My Equipment, Online Tools, Music Gallery, Friend Chain Fish Pond, Photo Album Page, Douban Page, Barrage message page.
|
55
|
+
- Article features: AI summary, code highlighting.
|
56
56
|
|
57
57
|
## Todo
|
58
58
|
|
@@ -60,9 +60,9 @@
|
|
60
60
|
- [x] Use double comment
|
61
61
|
- [x] Album
|
62
62
|
- [x] Barrage message page
|
63
|
-
- [
|
63
|
+
- [x] New style at the top of the home page
|
64
64
|
|
65
|
-
> If you have any questions, please issue an [issue](https://github.com/
|
65
|
+
> If you have any questions, please issue an [issue](https://github.com/everfu/hexo-theme-solitude/issues)
|
66
66
|
|
67
67
|
## Setup
|
68
68
|
|
@@ -87,4 +87,4 @@ Check out the [Documentation](https://solitude.js.org/) for more information.
|
|
87
87
|
|
88
88
|
## License
|
89
89
|
|
90
|
-
[MIT](./LICENSE) License © 2023-PRESENT [
|
90
|
+
[MIT](./LICENSE) License © 2023-PRESENT [Ever Fu](https://github.com/everfu)
|
package/README_zh-Hant.md
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|

|
14
14
|

|
15
15
|

|
16
|
-
[](https://github.com/
|
16
|
+
[](https://github.com/everfu/hexo-theme-solitude/stargazers)
|
17
17
|
[](https://www.npmjs.com/package/hexo-theme-solitude)
|
18
18
|
|
19
19
|

|
@@ -46,13 +46,13 @@
|
|
46
46
|
|
47
47
|
## 特性
|
48
48
|
|
49
|
-
- 頁面懶載入(Pjax)、圖片懶載入(LazyLoad)、離線應用(PWA)
|
50
|
-
- 評論(Twikoo、Waline、Valine、Artalk)
|
51
|
-
- 晝夜切換(ColorMode)
|
52
|
-
- 燈箱(medium-zoom、fancybox)
|
53
|
-
- 數學公式(Latex)
|
54
|
-
-
|
55
|
-
- 文章功能:AI
|
49
|
+
- 頁面懶載入(Pjax)、圖片懶載入(LazyLoad)、離線應用(PWA) 。
|
50
|
+
- 評論(Twikoo、Waline、Valine、Artalk、Giscus),支援雙評論。
|
51
|
+
- 晝夜切換(ColorMode) 。
|
52
|
+
- 燈箱(medium-zoom、fancybox) 。
|
53
|
+
- 數學公式(Latex) 。
|
54
|
+
- 特色頁面:即刻短文、我的裝備、在線工具、音樂館、友鏈魚塘、相冊頁、豆瓣頁、留言彈幕頁。
|
55
|
+
- 文章功能:AI 摘要、代碼高亮。
|
56
56
|
|
57
57
|
## Todo
|
58
58
|
|
@@ -60,7 +60,7 @@
|
|
60
60
|
- [x] 雙評論
|
61
61
|
- [x] 相冊
|
62
62
|
- [x] 留言彈幕頁
|
63
|
-
- [
|
63
|
+
- [x] 首頁頂部新樣式
|
64
64
|
|
65
65
|
## 應用
|
66
66
|
|
@@ -85,4 +85,4 @@
|
|
85
85
|
|
86
86
|
## 版權
|
87
87
|
|
88
|
-
[MIT](./LICENSE) License © 2023-至今 [Efu](https://github.com/
|
88
|
+
[MIT](./LICENSE) License © 2023-至今 [Efu](https://github.com/everfu)
|
package/SECURITY.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## Report a vulnerability
|
4
4
|
|
5
|
-
To report a vulnerability, please [report privately via security tab](https://github.com/
|
5
|
+
To report a vulnerability, please [report privately via security tab](https://github.com/everfu/hexo-theme-solitude/security/advisories/new) on the correct GitHub repository (see [Document](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability)). If you are unable to report, please feel free to email us at o@efu.me.
|
6
6
|
|
7
7
|
All security vulnerabilities will be verified and resolved in a timely manner.
|
8
8
|
|
package/_config.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#---------------------------
|
2
2
|
# Hexo Theme Solitude
|
3
|
-
# Author:
|
4
|
-
# Github: https://github.com/
|
3
|
+
# Author: EverFu
|
4
|
+
# Github: https://github.com/everfu/hexo-theme-solitude
|
5
5
|
#
|
6
6
|
# 配置指南: https://solitude.js.org/
|
7
7
|
# 你可以从指南中获得更详细的说明
|
@@ -9,8 +9,8 @@
|
|
9
9
|
# Guide: https://solitude.js.org/
|
10
10
|
# You can get more detailed help from the guide
|
11
11
|
#
|
12
|
-
# 赞助:https://afdian.net/a/
|
13
|
-
# sponsor: https://
|
12
|
+
# 赞助:https://afdian.net/a/everfu
|
13
|
+
# sponsor: https://github.com/sponsors/everfu
|
14
14
|
#---------------------------
|
15
15
|
|
16
16
|
# 站点设置
|
@@ -38,7 +38,7 @@ nav:
|
|
38
38
|
# logo group
|
39
39
|
group:
|
40
40
|
# 项目: # 分类名称
|
41
|
-
# Solitude: https://github.com/
|
41
|
+
# Solitude: https://github.com/everfu/hexo-theme-solitude || /img/pwa/favicon.ico # 子菜单名称(submenu name): 链接地址(address) || 图标(icon)
|
42
42
|
|
43
43
|
# 中心菜单
|
44
44
|
# center menu
|
@@ -133,7 +133,7 @@ hometop:
|
|
133
133
|
url: https://solitude.js.org/
|
134
134
|
# 显示背景图片
|
135
135
|
# Display background image
|
136
|
-
img: /img/default.
|
136
|
+
img: /img/default.avif
|
137
137
|
# 阴影颜色
|
138
138
|
# Shadow color
|
139
139
|
color: "none"
|
@@ -180,7 +180,7 @@ aside:
|
|
180
180
|
author:
|
181
181
|
# 头像
|
182
182
|
# Avatar
|
183
|
-
img: /img/avatar.
|
183
|
+
img: /img/avatar.avif
|
184
184
|
# 表情图片链接
|
185
185
|
# Emoticon image link
|
186
186
|
# tip: 26x26 size
|
@@ -210,19 +210,19 @@ aside:
|
|
210
210
|
# 个人信息卡片顶部按钮的切换文字
|
211
211
|
# Switching text of the button at the top of the personal information card
|
212
212
|
sayhello2: # 样式为2时无效
|
213
|
-
#
|
214
|
-
#
|
215
|
-
#
|
216
|
-
#
|
217
|
-
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
213
|
+
# - 🤖️ 数码科技爱好者
|
214
|
+
# - 🔍 分享与热心帮助
|
215
|
+
# - 🏠 智能家居小能手
|
216
|
+
# - 🔨 设计开发一条龙
|
217
|
+
# - 🤝 专修交互与设计
|
218
|
+
# - 🏃 脚踏实地行动派
|
219
|
+
# - 🧱 团队小组发动机
|
220
|
+
# - 💢 壮汉人狠话不多
|
221
|
+
# - 🎮 电竞游戏爱好者
|
222
222
|
# 个人信息卡片底部的小图标,按照例子填写
|
223
223
|
information: # 样式为1时请不要超过4个
|
224
|
-
#
|
225
|
-
#
|
224
|
+
# Github: https://github.com/efuo || st-github-line # 名称:链接 || 图标 / Name: link || icon
|
225
|
+
# Bilibili: https://space.bilibili.com/1329819902 || st-bilibili-line
|
226
226
|
|
227
227
|
# 二维码
|
228
228
|
# Official account QR code
|
@@ -369,13 +369,13 @@ post:
|
|
369
369
|
share:
|
370
370
|
enable: false
|
371
371
|
list:
|
372
|
-
#
|
373
|
-
#
|
374
|
-
#
|
375
|
-
#
|
376
|
-
#
|
377
|
-
#
|
378
|
-
#
|
372
|
+
# - qq
|
373
|
+
# - weibo
|
374
|
+
# - twitter
|
375
|
+
# - facebook
|
376
|
+
# - telegram
|
377
|
+
# - whatsapp
|
378
|
+
# - linkedin
|
379
379
|
# 版权中订阅按钮跳转链接,填写地址后开启
|
380
380
|
# Subscription button jump link in copyright
|
381
381
|
rss: # /atom.xml
|
@@ -443,11 +443,11 @@ footer:
|
|
443
443
|
information:
|
444
444
|
author: false # 是否显示 site_icon / enable site_icon in footer
|
445
445
|
left: # 左侧显示图标
|
446
|
-
#
|
447
|
-
#
|
446
|
+
# Github: https://github.com/efuo || st-github-line # 名称:链接 || 图标 / Name: link || icon
|
447
|
+
# Mail: mailto:o@efu.me || st-mail-line
|
448
448
|
right: # 右侧显示图标
|
449
|
-
#
|
450
|
-
#
|
449
|
+
# Bilibili: https://space.bilibili.com/1329819902 || st-bilibili-line
|
450
|
+
# 抖音: https://v.douyin.com/iJsLc8jt/ || st-douyin-fill
|
451
451
|
|
452
452
|
# 底部导航栏
|
453
453
|
# Bottom navigation bar
|
@@ -483,7 +483,7 @@ footer:
|
|
483
483
|
# 为了主题能够得到更多的支持,建议保留主题链接
|
484
484
|
# In order for the theme to get more support, it is recommended to keep the theme link
|
485
485
|
- name: 主题
|
486
|
-
url: https://github.com/
|
486
|
+
url: https://github.com/everfu/hexo-theme-solitude
|
487
487
|
# - name: 订阅
|
488
488
|
# url: /atom.xml
|
489
489
|
|
@@ -491,7 +491,7 @@ footer:
|
|
491
491
|
errorpage:
|
492
492
|
# 图片
|
493
493
|
# image
|
494
|
-
img: /img/404.
|
494
|
+
img: /img/404.avif
|
495
495
|
# 文字
|
496
496
|
# text
|
497
497
|
text: =awa= 页面走丢了
|
@@ -620,10 +620,10 @@ lazyload:
|
|
620
620
|
field: site # post, site
|
621
621
|
# 加载中显示图片
|
622
622
|
# Loading display image
|
623
|
-
placeholder: /img/loading.
|
623
|
+
placeholder: /img/loading.avif
|
624
624
|
# 加载失败显示图片
|
625
625
|
# Loading failed display image
|
626
|
-
errorimg: /img/error_load.
|
626
|
+
errorimg: /img/error_load.avif
|
627
627
|
|
628
628
|
# 加载动画
|
629
629
|
# loading animation
|
@@ -784,7 +784,7 @@ twikoo: # https://twikoo.js.org/
|
|
784
784
|
# waline 配置信息
|
785
785
|
# waline settings
|
786
786
|
waline: # https://waline.js.org/
|
787
|
-
envId:
|
787
|
+
envId: # url: https://waline.wzsco.top
|
788
788
|
pageview: false # 是否开启页面访问量统计 / Whether to enable page access statistics
|
789
789
|
option: # waline配置项 / waline configuration item
|
790
790
|
|
@@ -806,6 +806,18 @@ artalk:
|
|
806
806
|
site: # site name / 站点名
|
807
807
|
option: # options
|
808
808
|
|
809
|
+
# giscus 配置信息
|
810
|
+
# giscus settings
|
811
|
+
# docs: https://giscus.app/
|
812
|
+
giscus:
|
813
|
+
repo: # GitHub repository name
|
814
|
+
repo_id: # GitHub repository id
|
815
|
+
category_id: # GitHub repository category id
|
816
|
+
theme:
|
817
|
+
light: light
|
818
|
+
dark: dark
|
819
|
+
option: # options
|
820
|
+
|
809
821
|
# 中控台扩展 : 最新评论 + 标签 + 文章
|
810
822
|
console_plus: false
|
811
823
|
|
@@ -832,8 +844,8 @@ css_prefix: false
|
|
832
844
|
font:
|
833
845
|
font-size: 16px
|
834
846
|
code-font-size: 16px
|
835
|
-
font-family:
|
836
|
-
code-font-family:
|
847
|
+
font-family: "PingFang SC,Hiragino Sans GB,Microsoft YaHei"
|
848
|
+
code-font-family: "monospace, monospace"
|
837
849
|
|
838
850
|
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
|
839
851
|
# Insert code before </head> and before </body>
|
package/languages/default.yml
CHANGED
@@ -4,6 +4,7 @@ random: Random
|
|
4
4
|
upload: 'datetime: '
|
5
5
|
totalk: You don't need to delete blank lines, just type in your comments.
|
6
6
|
loading: Loading...
|
7
|
+
day: ' days'
|
7
8
|
|
8
9
|
theme:
|
9
10
|
dark: Dark
|
@@ -71,7 +72,7 @@ nav:
|
|
71
72
|
|
72
73
|
award:
|
73
74
|
thanks: Thanks
|
74
|
-
tipping:
|
75
|
+
tipping: Sponsor
|
75
76
|
title: List of appreciation
|
76
77
|
|
77
78
|
search:
|
@@ -97,6 +98,7 @@ aside:
|
|
97
98
|
back: Welcome back again,
|
98
99
|
sticker: Mood sticker
|
99
100
|
newpost: New posts
|
101
|
+
newcomment: New comments
|
100
102
|
card:
|
101
103
|
posts: 'Posts:'
|
102
104
|
tags: 'Tags:'
|
package/languages/en.yml
CHANGED
@@ -4,6 +4,7 @@ random: Random
|
|
4
4
|
upload: 'datetime: '
|
5
5
|
totalk: You don't need to delete blank lines, just type in your comments.
|
6
6
|
loading: Loading...
|
7
|
+
day: ' days'
|
7
8
|
|
8
9
|
theme:
|
9
10
|
dark: Dark
|
@@ -71,7 +72,7 @@ nav:
|
|
71
72
|
|
72
73
|
award:
|
73
74
|
thanks: Thanks
|
74
|
-
tipping:
|
75
|
+
tipping: Sponsor
|
75
76
|
title: List of appreciation
|
76
77
|
|
77
78
|
search:
|
@@ -97,6 +98,7 @@ aside:
|
|
97
98
|
back: Welcome back again,
|
98
99
|
sticker: Mood sticker
|
99
100
|
newpost: New posts
|
101
|
+
newcomment: New comments
|
100
102
|
card:
|
101
103
|
posts: 'Posts:'
|
102
104
|
tags: 'Tags:'
|
package/languages/zh-CN.yml
CHANGED
@@ -4,6 +4,7 @@ random: 随便逛逛
|
|
4
4
|
upload: 发布时间:
|
5
5
|
totalk: 无需删除空行,直接输入评论即可
|
6
6
|
loading: 加载中...
|
7
|
+
day: ' 天'
|
7
8
|
|
8
9
|
# Language: 简体中文
|
9
10
|
theme:
|
@@ -99,6 +100,7 @@ aside:
|
|
99
100
|
back: 欢迎再次回来,
|
100
101
|
sticker: 心情贴纸
|
101
102
|
newpost: 最近发布
|
103
|
+
newcomment: 最新评论
|
102
104
|
card:
|
103
105
|
posts: '累计文章数:'
|
104
106
|
tags: '标签总数:'
|
package/languages/zh-TW.yml
CHANGED
@@ -4,6 +4,7 @@ random: 随便逛逛
|
|
4
4
|
upload: 發佈時間:
|
5
5
|
totalk: 無需刪除空行,直接輸入評論即可
|
6
6
|
loading: 加載中...
|
7
|
+
day: ' 天'
|
7
8
|
|
8
9
|
# Language: 繁體中文 (台灣)
|
9
10
|
theme:
|
@@ -99,6 +100,7 @@ aside:
|
|
99
100
|
back: 歡迎再次回來,
|
100
101
|
sticker: 心情贴纸
|
101
102
|
newpost: 最近发布
|
103
|
+
newcomment: 最新评论
|
102
104
|
card:
|
103
105
|
posts: '累計文章數:'
|
104
106
|
tags: '標籤總數:'
|
@@ -3,17 +3,18 @@ div#console
|
|
3
3
|
i.solitude.st-close-fill
|
4
4
|
if theme.console_plus
|
5
5
|
div.console-card-group
|
6
|
-
if theme.
|
6
|
+
if theme.recent_comments.enable && theme.recent_comments.img
|
7
7
|
div.console-card-group-left
|
8
8
|
div.console-card#card-newest-comments(onclick="sco.hideConsole()")
|
9
9
|
div.card-content
|
10
10
|
div.author-content-item-tips= _p('console.comment_tip')
|
11
11
|
div.author-content-item-title
|
12
12
|
| #{_p('console.comment_title')}
|
13
|
-
if theme.recent_comments.enable
|
13
|
+
if theme.recent_comments.enable
|
14
14
|
a.recent-comment-more(href=url_for(theme.recent_comments.page) title=_p('console.recent_comment_more'))
|
15
15
|
i.solitude.st-right-btn-fill
|
16
|
-
|
16
|
+
a.recent-comment-image(href=url_for(theme.recent_comments.page))
|
17
|
+
img(src=theme.recent_comments.img)
|
17
18
|
|
18
19
|
div.console-card-group-right
|
19
20
|
div.console-card.tags(onclick="sco.hideConsole()")
|
@@ -105,9 +105,6 @@ div
|
|
105
105
|
if theme.footer.randomlink
|
106
106
|
include ../widgets/randomlink.pug
|
107
107
|
|
108
|
-
// newest comment
|
109
|
-
include ../widgets/third-party/news-comment/newest-comment.pug
|
110
|
-
|
111
108
|
// pjax
|
112
109
|
!= partial("includes/widgets/third-party/pjax", {}, {cache: true})
|
113
110
|
|
@@ -27,7 +27,7 @@ include ../head/pwa.pug
|
|
27
27
|
|
28
28
|
script.
|
29
29
|
console.log(
|
30
|
-
"%c Program: Hexo %c Theme: Solitude %c Version: v1.
|
30
|
+
"%c Program: Hexo %c Theme: Solitude %c Version: v1.12.0",
|
31
31
|
"border-radius:5px 0 0 5px;padding: 5px 10px;color:white;background:#ff3842;",
|
32
32
|
"padding: 5px 10px;color:white;background:#3e9f50;",
|
33
33
|
"padding: 5px 10px;color:white;background:#0084ff;border-radius:0 5px 5px 0",
|
@@ -39,7 +39,7 @@ if theme.memorial.enable
|
|
39
39
|
mdate = (mdate.split(","));
|
40
40
|
let ndate = new Date();
|
41
41
|
for (let i of mdate) {
|
42
|
-
if (i
|
42
|
+
if (i === (ndate.getMonth()+1) + "-" + (ndate.getDate())) {
|
43
43
|
document.documentElement.classList.add('memorial');
|
44
44
|
}
|
45
45
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.card-widget.card-recent-comment
|
2
|
+
.item-headline
|
3
|
+
i.solitude.st-chat-fill
|
4
|
+
span= _p('aside.newcomment')
|
5
|
+
if theme.recent_comments.enable
|
6
|
+
a.recent-comment-more(href=url_for(theme.recent_comments.page) title=_p('console.recent_comment_more'))
|
7
|
+
i.solitude.st-right-btn-fill
|
8
|
+
.aside-list
|
9
|
+
include ../third-party/news-comment/newest-comment.pug
|
@@ -23,8 +23,8 @@ script.
|
|
23
23
|
})
|
24
24
|
const $content = comment.getRender().$content
|
25
25
|
GLOBAL_CONFIG.lightbox && utils.lightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
26
|
-
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
|
27
26
|
})
|
27
|
+
sco.owoBig({body: '.atk-grp', item: '.atk-item'})
|
28
28
|
!{commentBarrage} && barrageArtalk(array)
|
29
29
|
})
|
30
30
|
const destroyArtalk = () => artalkItem.destroy()
|
@@ -0,0 +1,60 @@
|
|
1
|
+
- const { repo, repo_id, category_id, theme:themes, option } = theme.giscus
|
2
|
+
- const giscusUrl = theme.cdn.giscus || 'https://giscus.app/client.js'
|
3
|
+
- const giscusOriginUrl = new URL(giscusUrl).origin
|
4
|
+
- const { use, lazyload } = theme.comment
|
5
|
+
|
6
|
+
script.
|
7
|
+
(()=>{
|
8
|
+
const getGiscusTheme = theme => {
|
9
|
+
return theme === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
10
|
+
}
|
11
|
+
|
12
|
+
const loadGiscus = () => {
|
13
|
+
const config = Object.assign({
|
14
|
+
src: '!{giscusUrl}',
|
15
|
+
'data-repo': '!{repo}',
|
16
|
+
'data-repo-id': '!{repo_id}',
|
17
|
+
'data-category-id': '!{category_id}',
|
18
|
+
'data-mapping': 'pathname',
|
19
|
+
'data-theme': getGiscusTheme(document.documentElement.getAttribute('data-theme')),
|
20
|
+
'data-reactions-enabled': '1',
|
21
|
+
crossorigin: 'anonymous',
|
22
|
+
async: true
|
23
|
+
},!{JSON.stringify(option)})
|
24
|
+
|
25
|
+
const ele = document.createElement('script')
|
26
|
+
for (let key in config) {
|
27
|
+
ele.setAttribute(key, config[key])
|
28
|
+
}
|
29
|
+
document.getElementById('giscus-wrap').appendChild(ele)
|
30
|
+
}
|
31
|
+
|
32
|
+
const changeGiscusTheme = theme => {
|
33
|
+
const sendMessage = message => {
|
34
|
+
const iframe = document.querySelector('iframe.giscus-frame')
|
35
|
+
if (!iframe) return
|
36
|
+
iframe.contentWindow.postMessage({ giscus: message }, '!{giscusOriginUrl}')
|
37
|
+
}
|
38
|
+
|
39
|
+
sendMessage({
|
40
|
+
setConfig: {
|
41
|
+
theme: getGiscusTheme(theme)
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
utils.addGlobalFn('themeChange', changeGiscusTheme, 'giscus')
|
47
|
+
|
48
|
+
if ('!{use[0]}' === 'Giscus' || !!{lazyload}) {
|
49
|
+
if (!{lazyload}) {
|
50
|
+
const giscusWrap = document.getElementById('giscus-wrap')
|
51
|
+
if (giscusWrap) {
|
52
|
+
utils.loadComment(giscusWrap, loadGiscus)
|
53
|
+
}
|
54
|
+
} else {
|
55
|
+
loadGiscus()
|
56
|
+
}
|
57
|
+
} else {
|
58
|
+
window.loadOtherComment = loadGiscus
|
59
|
+
}
|
60
|
+
})()
|
@@ -9,4 +9,6 @@ each name in use
|
|
9
9
|
when 'Valine'
|
10
10
|
!=partial('includes/widgets/third-party/comments/valine', {}, {cache: true})
|
11
11
|
when 'Artalk'
|
12
|
-
!=partial('includes/widgets/third-party/comments/artalk', {}, {cache: true})
|
12
|
+
!=partial('includes/widgets/third-party/comments/artalk', {}, {cache: true})
|
13
|
+
when 'Giscus'
|
14
|
+
!=partial('includes/widgets/third-party/comments/giscus', {}, {cache: true})
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- const { server, site, option } = theme.artalk
|
2
2
|
- const avatarCdn = theme.comment.avatar
|
3
3
|
|
4
|
-
script.
|
5
|
-
|
4
|
+
script(pjax).
|
5
|
+
(() => {
|
6
6
|
const changeContent = content => {
|
7
7
|
if (content === '') return content;
|
8
8
|
const replacements = [
|
@@ -24,15 +24,14 @@ script.
|
|
24
24
|
}
|
25
25
|
];
|
26
26
|
content = replacements.reduce((str, {regex, replacement}) => str.replace(regex, replacement), content);
|
27
|
-
return content.length > 150 ? content.substring(0,
|
27
|
+
return content.length > 150 ? content.substring(0, 100) + '...' : content;
|
28
28
|
};
|
29
29
|
|
30
30
|
const generateHtml = (array, asideList) => {
|
31
31
|
asideList.innerHTML = array.length ? array.map(item => `
|
32
32
|
<div class='aside-list-item'>
|
33
|
-
<div
|
33
|
+
<div class='thumbnail'>
|
34
34
|
<img src='${item.avatar}' alt='${item.nick}'>
|
35
|
-
<div class='name'><span>${item.nick}</span></div>
|
36
35
|
</div>
|
37
36
|
<div class='content'>
|
38
37
|
<div class='comment' onclick='pjax.loadUrl("${item.url}")'>${item.content}</div>
|
@@ -68,7 +67,7 @@ script.
|
|
68
67
|
nick: e.nick,
|
69
68
|
url: e.page_key + `#atk-comment-${e.id}`,
|
70
69
|
date: e.date,
|
71
|
-
})).slice(0,
|
70
|
+
})).slice(0, !{limit});
|
72
71
|
utils.saveToLocal.set('artalk-newest-comments', artalk, !{theme.comment.newest_comment.storage});
|
73
72
|
generateHtml(artalk, asideList);
|
74
73
|
}).catch(error => {
|
@@ -78,6 +77,7 @@ script.
|
|
78
77
|
};
|
79
78
|
|
80
79
|
const newestCommentInit = (asideList) => {
|
80
|
+
if (!asideList) return;
|
81
81
|
const data = utils.saveToLocal.get('artalk-newest-comments');
|
82
82
|
if (data) {
|
83
83
|
generateHtml(data, asideList);
|
@@ -86,9 +86,7 @@ script.
|
|
86
86
|
}
|
87
87
|
};
|
88
88
|
|
89
|
-
const $asideList = document.querySelector('
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}
|
94
|
-
});
|
89
|
+
const $asideList = document.querySelector('.card-recent-comment .aside-list');
|
90
|
+
window.addEventListener('DOMContentLoaded', () => newestCommentInit($asideList), false)
|
91
|
+
window.addEventListener('pjax:complete', () => newestCommentInit(document.querySelector('.card-recent-comment .aside-list')), false);
|
92
|
+
})();
|