hexo-theme-solitude 2.1.4 → 2.1.6
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/README.md +25 -39
- package/{README_zh-Hans.md → README_en-US.md} +25 -39
- package/README_zh-Hant.md +4 -18
- package/_config.yml +30 -28
- 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/head/config.pug +2 -1
- package/layout/includes/head/page_config.pug +3 -1
- package/layout/includes/keyboard.pug +2 -1
- package/layout/includes/loading.pug +1 -1
- package/layout/includes/widgets/aside/aside.pug +1 -1
- package/layout/includes/widgets/aside/asideInfoCard.pug +2 -2
- package/layout/includes/widgets/page/links/banner.pug +15 -12
- package/layout/includes/widgets/rightside/show.pug +1 -1
- package/layout/includes/widgets/third-party/music.pug +1 -1
- package/layout/includes/widgets/third-party/search/algolia-search.pug +3 -0
- package/layout/post.pug +2 -1
- package/package.json +1 -1
- package/plugins.yml +2 -2
- package/scripts/event/cdn.js +1 -1
- package/scripts/event/page.js +3 -3
- package/scripts/filter/default.js +3 -1
- package/scripts/tags/article.js +1 -1
- package/scripts/tags/typeit.js +2 -3
- package/source/css/_highlight/index.styl +9 -0
- package/source/css/_layout/article-container.styl +1 -1
- package/source/css/_page/_home/category-bar.styl +1 -0
- package/source/css/_page/_home/home.styl +4 -0
- package/source/css/_post/pagination.styl +1 -1
- package/source/css/_search/algolia-search.styl +23 -16
- package/source/css/_search/local-search.styl +11 -11
- package/source/css/_tags/gallery.styl +0 -1
- package/source/js/main.js +8 -2
- package/source/js/search/algolia.js +16 -15
- package/source/js/search/local.js +11 -14
package/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
English
|
1
|
+
[English](README_en-US.md)丨简体中文丨[繁体中文](README_zh-Hant.md)
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
|
5
|
+
<h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
|
6
6
|
|
7
|
-
|
7
|
+
一款优雅的 Hexo 主题,支持懒加载、PWA、Latex 以及多种评论系统。
|
8
8
|
|
9
|
-
|
9
|
+
主题设计由 [@张洪Heo](https://github.com/zhheo) 全权授权
|
10
10
|
|
11
11
|

|
12
12
|

|
@@ -16,11 +16,11 @@ English丨[简体中文](README_zh-Hans.md)丨[繁体中文](README_zh-Hant.md)
|
|
16
16
|

|
17
17
|

|
18
18
|
|
19
|
-

|
20
20
|
[](https://discord.gg/HZXAnK4Sut)
|
21
21
|

|
22
22
|
|
23
|
-
[
|
23
|
+
[文档](https://solitude.js.org/)丨[预览](https://blog.everfu.cn/)
|
24
24
|
|
25
25
|
</div>
|
26
26
|
|
@@ -30,57 +30,43 @@ English丨[简体中文](README_zh-Hans.md)丨[繁体中文](README_zh-Hant.md)
|
|
30
30
|
|
31
31
|
</div>
|
32
32
|
|
33
|
-
##
|
33
|
+
## 特性
|
34
34
|
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
35
|
+
- 页面懒加载(Pjax)、图片懒加载(LazyLoad)、离线应用(PWA)
|
36
|
+
- 评论(Twikoo、Waline、Valine、Artalk、Giscus),支持双评论
|
37
|
+
- 昼夜切换(ColorMode)
|
38
|
+
- 灯箱(medium-zoom、fancybox)
|
39
|
+
- 数学公式(Latex)
|
40
|
+
- 特色页面:即刻短文、我的装备、在线工具、音乐馆、友链鱼塘、相册页、豆瓣页、弹幕留言页
|
41
|
+
- 文章功能:AI 摘要、代码高亮
|
42
42
|
|
43
43
|
## Todo
|
44
44
|
|
45
|
-
- [
|
46
|
-
- [
|
45
|
+
- [x] 移动端目录支持
|
46
|
+
- [x] 增加右下角侧边栏
|
47
47
|
|
48
|
-
>
|
48
|
+
> 如有问题请提 [issue](https://github.com/everfu/hexo-theme-solitude/issues)
|
49
49
|
|
50
|
-
##
|
50
|
+
## 应用
|
51
51
|
|
52
|
-
1.
|
52
|
+
1. 使用 NPM 包进行安装
|
53
53
|
```bash
|
54
54
|
npm i hexo-theme-solitude
|
55
55
|
```
|
56
|
-
2.
|
56
|
+
2. 应用主题
|
57
57
|
```yaml
|
58
58
|
theme: solitude
|
59
59
|
```
|
60
60
|
|
61
|
-
|
61
|
+
前往 [文档](https://solitude.js.org/) 获取更多信息。
|
62
62
|
|
63
|
-
##
|
64
|
-
|
65
|
-
<div align="center">
|
66
|
-
|
67
|
-
[](https://ko-fi.com/W7W1YSMOK)
|
68
|
-
|
69
|
-
</div>
|
70
|
-
|
71
|
-
<p align="center">
|
72
|
-
<a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
|
73
|
-
<img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg' alt="sponsor"/>
|
74
|
-
</a>
|
75
|
-
</p>
|
76
|
-
|
77
|
-
## Community
|
63
|
+
## 社区
|
78
64
|
|
79
65
|
[](https://discord.gg/HZXAnK4Sut)
|
80
|
-
[](https://qm.qq.com/q/mxfomMvJPG)
|
81
67
|
|
82
|
-
##
|
68
|
+
## 版权
|
83
69
|
|
84
|
-
[MIT](./LICENSE) License © 2023
|
70
|
+
[MIT](./LICENSE) License © 2023-至今 [伍十七](https://github.com/everfu)
|
85
71
|
|
86
72
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
|
@@ -1,12 +1,12 @@
|
|
1
|
-
[
|
1
|
+
English丨[简体中文](README.md)丨[繁体中文](README_zh-Hant.md)
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
<h1>Solitude</h1>
|
5
|
+
<h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
|
6
6
|
|
7
|
-
|
7
|
+
An elegant Hexo theme that supports lazy loading, PWA, Latex, and multiple commenting systems.
|
8
8
|
|
9
|
-
|
9
|
+
Theme design is fully licensed by [@张洪Heo](https://github.com/zhheo).
|
10
10
|
|
11
11
|

|
12
12
|

|
@@ -16,11 +16,11 @@
|
|
16
16
|

|
17
17
|

|
18
18
|
|
19
|
-

|
20
20
|
[](https://discord.gg/HZXAnK4Sut)
|
21
21
|

|
22
22
|
|
23
|
-
[
|
23
|
+
[Docs](https://solitude.js.org/)丨[Preview](https://blog.everfu.cn/)
|
24
24
|
|
25
25
|
</div>
|
26
26
|
|
@@ -30,57 +30,43 @@
|
|
30
30
|
|
31
31
|
</div>
|
32
32
|
|
33
|
-
##
|
33
|
+
## Features
|
34
34
|
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
-
|
40
|
-
-
|
41
|
-
-
|
35
|
+
- Page lazy loading (Pjax), image lazy loading (LazyLoad), offline application (PWA)
|
36
|
+
- Comments (Twikoo, Waline, Valine, Artalk, Giscus), supporting dual comments
|
37
|
+
- Day and night mode switch (ColorMode)
|
38
|
+
- Lightbox (medium-zoom, fancybox)
|
39
|
+
- Mathematical formulas (Latex)
|
40
|
+
- Special pages: Moments, My Equipment, Online Tools, Music Library, Friends' Links, Photo Album, Douban Page, Danmaku Message Board
|
41
|
+
- Article features: AI Summary, Code Highlighting
|
42
42
|
|
43
43
|
## Todo
|
44
44
|
|
45
|
-
- [
|
46
|
-
- [
|
45
|
+
- [X] Mobile directory support.
|
46
|
+
- [X] Add a bottom right sidebar.
|
47
47
|
|
48
|
-
>
|
48
|
+
> If you have any questions, please issue an [issue](https://github.com/everfu/hexo-theme-solitude/issues)
|
49
49
|
|
50
|
-
##
|
50
|
+
## Setup
|
51
51
|
|
52
|
-
1.
|
52
|
+
1. Use the NPM package
|
53
53
|
```bash
|
54
54
|
npm i hexo-theme-solitude
|
55
55
|
```
|
56
|
-
2.
|
56
|
+
2. Apply
|
57
57
|
```yaml
|
58
58
|
theme: solitude
|
59
59
|
```
|
60
60
|
|
61
|
-
|
61
|
+
Check out the [Documentation](https://solitude.js.org/) for more information.
|
62
62
|
|
63
|
-
##
|
64
|
-
|
65
|
-
<div align="center">
|
66
|
-
|
67
|
-
[](https://ko-fi.com/W7W1YSMOK)
|
68
|
-
|
69
|
-
</div>
|
70
|
-
|
71
|
-
<p align="center">
|
72
|
-
<a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
|
73
|
-
<img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg' alt="赞助者"/>
|
74
|
-
</a>
|
75
|
-
</p>
|
76
|
-
|
77
|
-
## 社区
|
63
|
+
## Community
|
78
64
|
|
79
65
|
[](https://discord.gg/HZXAnK4Sut)
|
80
|
-
[](https://qm.qq.com/q/mxfomMvJPG)
|
81
67
|
|
82
|
-
##
|
68
|
+
## License
|
83
69
|
|
84
|
-
[MIT](./LICENSE) License © 2023
|
70
|
+
[MIT](./LICENSE) License © 2023-PRESENT [伍十七](https://github.com/everfu)
|
85
71
|
|
86
72
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
|
package/README_zh-Hant.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
[English](
|
1
|
+
[English](README_en-US.md)丨[简体中文](README.md)丨繁体中文
|
2
2
|
|
3
3
|
<div align="center">
|
4
4
|
|
5
|
-
<h1>Solitude</h1>
|
5
|
+
<h1 style="background: linear-gradient(to right, #76CBEC, #F7A137); -webkit-background-clip: text; color: transparent; font-size: 4.4rem">Solitude</h1>
|
6
6
|
|
7
7
|
一款優雅的 Hexo 主題,支援懶載入、PWA、Latex 以及多種評論系統。
|
8
8
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|

|
17
17
|

|
18
18
|
|
19
|
-

|
20
20
|
[](https://discord.gg/HZXAnK4Sut)
|
21
21
|

|
22
22
|
|
@@ -58,20 +58,6 @@
|
|
58
58
|
|
59
59
|
前往 [文檔](https://solitude.js.org/) 獲取更多資訊。
|
60
60
|
|
61
|
-
## 贊助者
|
62
|
-
|
63
|
-
<div align="center">
|
64
|
-
|
65
|
-
[](https://ko-fi.com/W7W1YSMOK)
|
66
|
-
|
67
|
-
</div>
|
68
|
-
|
69
|
-
<p align="center">
|
70
|
-
<a href="https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg">
|
71
|
-
<img src='https://cdn.jsdelivr.net/gh/efuo/static/sponsors.svg'/>
|
72
|
-
</a>
|
73
|
-
</p>
|
74
|
-
|
75
61
|
## 社區
|
76
62
|
|
77
63
|
[](https://discord.gg/HZXAnK4Sut)
|
@@ -79,6 +65,6 @@
|
|
79
65
|
|
80
66
|
## 版權
|
81
67
|
|
82
|
-
[MIT](./LICENSE) License © 2023-至今 [
|
68
|
+
[MIT](./LICENSE) License © 2023-至今 [伍十七](https://github.com/everfu)
|
83
69
|
|
84
70
|
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fvalor-x%2Fhexo-theme-solitude?ref=badge_large)
|
package/_config.yml
CHANGED
@@ -37,30 +37,29 @@ nav:
|
|
37
37
|
# Menu
|
38
38
|
# 菜单
|
39
39
|
menu:
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# About: /about/
|
40
|
+
# 首页: / # name: link
|
41
|
+
# 文库: # name
|
42
|
+
# 全部文章: /archives/ || fas fa-folder-closed # item name: link || icon
|
43
|
+
# 全部分类: /categories/ || fas fa-clone
|
44
|
+
# 全部标签: /tags/ || fas fa-tags
|
45
|
+
# 友链:
|
46
|
+
# 朋友圈: /moments/ || fas fa-wifi
|
47
|
+
# 友情链接: /links/ || fas fa-user-group
|
48
|
+
# 宝藏博主: javascript:travelling() || fas fa-gift
|
49
|
+
# 关于:
|
50
|
+
# 我的装备: /equipment/ || fas fa-laptop
|
51
|
+
# 在线工具: /tlink/ || fas fa-toolbox
|
52
|
+
# 音乐馆: /music/ || fas fa-music
|
54
53
|
|
55
54
|
# Right button
|
56
55
|
# 右侧按钮
|
57
56
|
right:
|
58
57
|
random: false # Random article / 随机文章按钮
|
59
58
|
custom:
|
60
|
-
# - name:
|
61
|
-
# url: https://www.travellings.cn/go.html #
|
62
|
-
# icon: fas fa-train #
|
63
|
-
# onclick: #
|
59
|
+
# - name: 开往 # 名字
|
60
|
+
# url: https://www.travellings.cn/go.html # 跳转链接
|
61
|
+
# icon: fas fa-train # 图标
|
62
|
+
# onclick: # 点击事件
|
64
63
|
# id: travellings_button # id
|
65
64
|
# --------------------------- end ---------------------------
|
66
65
|
|
@@ -70,8 +69,8 @@ nav:
|
|
70
69
|
hometop:
|
71
70
|
enable: false
|
72
71
|
banner:
|
73
|
-
title: #
|
74
|
-
url: Hexo Theme Solitude
|
72
|
+
title: # 宁静致远 <br> 热爱生活 # 标题
|
73
|
+
url: Hexo Theme Solitude # 小字
|
75
74
|
icon:
|
76
75
|
# HTML: # name
|
77
76
|
# img: https://i.postimg.cc/vBWVnY8q/html.png # url
|
@@ -143,17 +142,17 @@ aside:
|
|
143
142
|
# Style 2 is invalid
|
144
143
|
# Style 2 无效
|
145
144
|
sayhello:
|
146
|
-
morning: ✨
|
147
|
-
noon:
|
148
|
-
afternoon:
|
149
|
-
night:
|
150
|
-
goodnight:
|
145
|
+
morning: ✨ 早上好,新的一天开始了
|
146
|
+
noon: 🍲 午餐时间
|
147
|
+
afternoon: 🌞 下午好
|
148
|
+
night: 早点休息
|
149
|
+
goodnight: 晚安 😴
|
151
150
|
# Style 2 is invalid, Triggered when sayhello is clicked.
|
152
151
|
# Style 2 无效, 点击 sayhello 时触发
|
153
152
|
sayhello2:
|
154
|
-
# -
|
155
|
-
# -
|
156
|
-
# -
|
153
|
+
# - 你可以的
|
154
|
+
# - 你一定可以的
|
155
|
+
# - 祝你好运,陌生人
|
157
156
|
# social
|
158
157
|
# 社交信息图标
|
159
158
|
information:
|
@@ -658,6 +657,9 @@ loading:
|
|
658
657
|
# Full screen loading
|
659
658
|
# 全屏加载
|
660
659
|
fullpage: false
|
660
|
+
# Loading icon, default is siteicon
|
661
|
+
# 加载图标,不写默认siteicon
|
662
|
+
favicon: /img/favicon.png
|
661
663
|
# Pace loading
|
662
664
|
# Pace 加载
|
663
665
|
pace: true
|
package/languages/default.yml
CHANGED
package/languages/en.yml
CHANGED
package/languages/zh-CN.yml
CHANGED
package/languages/zh-TW.yml
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
- var showToc = !!page.toc && (toc(page.content) !== '' || page.encrypt === true);
|
2
|
+
|
1
3
|
script#config-diff.
|
2
4
|
var PAGE_CONFIG = {
|
3
5
|
is_post: !{is_post()},
|
4
6
|
is_page: !{!is_post() && !is_home()},
|
5
7
|
is_home: !{is_home()},
|
6
8
|
page: '!{page.type}',
|
7
|
-
toc: !{
|
9
|
+
toc: !{showToc},
|
8
10
|
comment: !{!!page.comment},
|
9
11
|
ai_text: !{is_post && page.ai_text ? "'"+ page.ai_text+"'" : false},
|
10
12
|
color: !{page.color ? "'"+ page.color+"'" : false},
|
@@ -61,5 +61,6 @@ script.
|
|
61
61
|
var sco_keyboards = localStorage.getItem('keyboard') === 'true'
|
62
62
|
if (sco_keyboards) {
|
63
63
|
openKeyboard();
|
64
|
-
document.getElementById('consoleKeyboard')
|
64
|
+
let keyboard = document.getElementById('consoleKeyboard');
|
65
|
+
keyboard?.classList.add('on');
|
65
66
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
div(id="loading-box" onclick="preloader.endLoading();" style="zoom:1")
|
2
2
|
div.loading-bg
|
3
|
-
img.loading-img.nolazyload(src=url_for(theme.site.icon), alt="loading image")
|
3
|
+
img.loading-img.nolazyload(src=url_for(theme.loading.favicon || theme.site.icon), alt="loading image")
|
4
4
|
|
5
5
|
script.
|
6
6
|
const preloader = {
|
@@ -43,11 +43,11 @@
|
|
43
43
|
a(href=url_for('/archives/') title=_p('aside.card.posts') + site.posts.length)
|
44
44
|
.length-num= site.posts.length
|
45
45
|
.headline= _p('page.archives')
|
46
|
-
if site.tags.length !== 0
|
46
|
+
if site.tags.length !== 0 || theme.page.tags
|
47
47
|
a(href=url_for('/tags/') title=_p('aside.card.tags') + site.tags.length)
|
48
48
|
.length-num= site.tags.length
|
49
49
|
.headline= _p('page.tag')
|
50
|
-
if site.categories.length !== 0
|
50
|
+
if site.categories.length !== 0 || theme.page.categories
|
51
51
|
a(href=url_for('/categories/') title=_p('aside.card.categories') + site.categories.length)
|
52
52
|
.length-num= site.categories.length
|
53
53
|
.headline= _p('page.category')
|
@@ -16,16 +16,19 @@
|
|
16
16
|
.tags-group-wrapper
|
17
17
|
- const data = site.data.links.links
|
18
18
|
- for (let i = 0; i < 2; i++)
|
19
|
+
- var links = []
|
19
20
|
each x in data
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
21
|
+
each y in x.link_list
|
22
|
+
- links.push(y)
|
23
|
+
- var pairs = []
|
24
|
+
each link, index in links
|
25
|
+
if (index % 2 === 0)
|
26
|
+
- pairs.push([link])
|
27
|
+
else
|
28
|
+
- pairs[pairs.length - 1].push(link)
|
29
|
+
each pair in pairs
|
30
|
+
.tags-group-icon-pair
|
31
|
+
each y in pair
|
32
|
+
a.tags-group-icon(href=url_for(y.link), title=y.name)
|
33
|
+
img(src=y.avatar + (site.data.links.banner_suffix || ''), title=y.name)
|
34
|
+
span.tags-group-title=y.name
|
@@ -2,7 +2,7 @@
|
|
2
2
|
if theme.rightside.hide.enable
|
3
3
|
button.config(type='button' title=_p('rightside.show.gear') onclick='document.querySelector(".rs_hide").classList.toggle("show")')
|
4
4
|
i.fas.fa-gear.fa-spin
|
5
|
-
if
|
5
|
+
if showToc
|
6
6
|
button.mobile.toc(type='button' title=_p('rightside.show.toc') onclick="document.querySelector('#card-toc').classList.toggle('open')")
|
7
7
|
i.fas.fa-list
|
8
8
|
if page.comment
|
@@ -1,3 +1,3 @@
|
|
1
1
|
div.needEndHide#nav-music
|
2
2
|
#nav-music-hoverTips(onclick='sco.musicToggle()')= __('music.hit')
|
3
|
-
meting-js(id=theme.capsule.id server=theme.capsule.server type=
|
3
|
+
meting-js(id=theme.capsule.id server=theme.capsule.server type=theme.capsule.type mutex="true" preload="none" theme="var(--efu-main)" data-lrctype="0" order="random" volume=theme.capsule.volume)
|
package/layout/post.pug
CHANGED
package/package.json
CHANGED
package/plugins.yml
CHANGED
package/scripts/event/cdn.js
CHANGED
@@ -142,6 +142,6 @@ hexo.extend.filter.register('before_generate', () => {
|
|
142
142
|
themeConfig.cdn = Object.assign(
|
143
143
|
createCDNLink(internalSrc, CDN.internal, 'internal'),
|
144
144
|
createCDNLink(thirdPartySrc, CDN.third_party),
|
145
|
-
deleteNullValue(CDN.
|
145
|
+
deleteNullValue(CDN.options)
|
146
146
|
)
|
147
147
|
})
|
package/scripts/event/page.js
CHANGED
@@ -5,7 +5,7 @@ hexo.extend.generator.register('404', function (locals) {
|
|
5
5
|
layout: ['404'],
|
6
6
|
data: {
|
7
7
|
type: '404',
|
8
|
-
comment: false
|
8
|
+
comment: false,
|
9
9
|
}
|
10
10
|
}
|
11
11
|
})
|
@@ -16,7 +16,7 @@ hexo.extend.generator.register('tags', function(locals) {
|
|
16
16
|
layout: ['page'],
|
17
17
|
data: {
|
18
18
|
type: 'tags',
|
19
|
-
comment: false
|
19
|
+
comment: false,
|
20
20
|
}
|
21
21
|
};
|
22
22
|
});
|
@@ -27,7 +27,7 @@ hexo.extend.generator.register('categories', function(locals) {
|
|
27
27
|
layout: ['page'],
|
28
28
|
data: {
|
29
29
|
type: 'categories',
|
30
|
-
comment: false
|
30
|
+
comment: false,
|
31
31
|
}
|
32
32
|
};
|
33
33
|
});
|
@@ -11,7 +11,8 @@ hexo.extend.filter.register('after_post_render', function (data) {
|
|
11
11
|
data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
|
12
12
|
data.excerpt = data.description || data.excerpt
|
13
13
|
data.toc = !!(config.aside.toc.post && data.toc !== false)
|
14
|
-
data.ai = data.ai !== false
|
14
|
+
data.ai = data.ai !== false;
|
15
|
+
data.aside = data.aside || true;
|
15
16
|
}
|
16
17
|
if (data.layout === 'page') {
|
17
18
|
let {cover} = hexo.theme.config.page.default
|
@@ -19,6 +20,7 @@ hexo.extend.filter.register('after_post_render', function (data) {
|
|
19
20
|
data.cover = data.cover || cover[getRandomInt(0, cover?.length)]
|
20
21
|
data.excerpt = data.title
|
21
22
|
data.toc = !!(config.aside.toc.page && data.toc !== false && data.aside);
|
23
|
+
data.aside = data.aside || false;
|
22
24
|
}
|
23
25
|
data.comment = !!(config.comment.use && data.comment !== false);
|
24
26
|
return data;
|
package/scripts/tags/article.js
CHANGED
package/scripts/tags/typeit.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
'use strict'
|
6
6
|
|
7
|
-
const typeit = ([tag
|
7
|
+
const typeit = ([tag], content) => {
|
8
8
|
const id = Math.random().toString(36).substr(2, 9);
|
9
9
|
tag = tag || 'div';
|
10
10
|
return `
|
@@ -15,8 +15,7 @@ const typeit = ([tag, options], content) => {
|
|
15
15
|
const typeit = () => {
|
16
16
|
const ctx = document.getElementById("typeit-${id}");
|
17
17
|
if (!ctx) return;
|
18
|
-
new TypeIt("#typeit-${id}", ${
|
19
|
-
.type("${content}")
|
18
|
+
new TypeIt("#typeit-${id}", {${content}})
|
20
19
|
.go();
|
21
20
|
}
|
22
21
|
document.addEventListener("DOMContentLoaded", typeit);
|
@@ -78,6 +78,15 @@ figure
|
|
78
78
|
font-size 1.15em
|
79
79
|
user-select none
|
80
80
|
|
81
|
+
.caption
|
82
|
+
position absolute
|
83
|
+
right 2.7rem
|
84
|
+
font-size 0.85em
|
85
|
+
color var(--efu-secondtext)
|
86
|
+
|
87
|
+
+maxWidth768()
|
88
|
+
display none
|
89
|
+
|
81
90
|
.code-expand-btn
|
82
91
|
background var(--efu-hltools-bg)
|
83
92
|
transition .3s
|
@@ -7,12 +7,14 @@
|
|
7
7
|
margin-left -15rem
|
8
8
|
padding 1rem
|
9
9
|
width 30rem
|
10
|
+
flex-direction column
|
10
11
|
box-shadow var(--efu-shadow-lightblack)
|
11
12
|
background var(--efu-card-bg)
|
12
13
|
border var(--style-border)
|
13
14
|
transition 0.3s
|
14
15
|
border-radius 8px
|
15
16
|
animation slide-in .6s ease 0s 1 normal none running
|
17
|
+
gap: 16px
|
16
18
|
|
17
19
|
&:hover
|
18
20
|
border var(--style-border-hover)
|
@@ -31,12 +33,10 @@
|
|
31
33
|
.algolia-navbar
|
32
34
|
display flex
|
33
35
|
align-items center
|
34
|
-
margin-bottom 8px
|
35
36
|
|
36
37
|
.search-close-button
|
37
|
-
|
38
|
-
|
39
|
-
right 1rem
|
38
|
+
margin-left: 4px
|
39
|
+
padding 4px
|
40
40
|
color var(--efu-gray)
|
41
41
|
font-size 1.4em
|
42
42
|
line-height 1
|
@@ -49,9 +49,6 @@
|
|
49
49
|
.algolia-tips-text
|
50
50
|
margin-left .4rem
|
51
51
|
|
52
|
-
#algolia-input-panel
|
53
|
-
margin-bottom 8px
|
54
|
-
|
55
52
|
.search-box, .ais-SearchBox
|
56
53
|
padding-top 8px
|
57
54
|
max-width 100%
|
@@ -77,7 +74,6 @@
|
|
77
74
|
visibility hidden
|
78
75
|
|
79
76
|
#search-results
|
80
|
-
padding-top 8px
|
81
77
|
max-height calc(80vh - 130px)
|
82
78
|
overflow-y auto
|
83
79
|
|
@@ -86,9 +82,7 @@
|
|
86
82
|
|
87
83
|
.ais-Hits-list
|
88
84
|
padding 0
|
89
|
-
|
90
|
-
.ais-Hits-item
|
91
|
-
margin 10px 0
|
85
|
+
margin 0
|
92
86
|
|
93
87
|
.algolia-hit-item-content
|
94
88
|
margin 0
|
@@ -104,17 +98,21 @@
|
|
104
98
|
overflow hidden
|
105
99
|
font-weight bold
|
106
100
|
|
101
|
+
&:hover
|
102
|
+
color var(--efu-main)
|
103
|
+
|
104
|
+
.ais-Stats-text
|
105
|
+
font-size 12px
|
106
|
+
|
107
107
|
mark
|
108
108
|
color var(--efu-theme)
|
109
109
|
font-style normal
|
110
110
|
background var(--efu-card-bg)
|
111
111
|
|
112
112
|
.ais-Hits--empty
|
113
|
-
text-align center
|
114
113
|
font-weight 600
|
115
114
|
|
116
115
|
.ais-Pagination-list
|
117
|
-
margin 0.2rem 0 0
|
118
116
|
padding 0
|
119
117
|
text-align center
|
120
118
|
|
@@ -134,15 +132,13 @@
|
|
134
132
|
|
135
133
|
.search-dialog__title
|
136
134
|
font-weight 700
|
137
|
-
padding 0 0 0.7rem
|
138
135
|
color var(--efu-main)
|
139
136
|
font-size 1.4em
|
140
137
|
line-height 1
|
141
138
|
|
142
139
|
#algolia-tips
|
143
|
-
padding-top 12px
|
144
140
|
color var(--efu-secondtext)
|
145
|
-
|
141
|
+
width 100%
|
146
142
|
margin auto
|
147
143
|
|
148
144
|
.algolia-tips-text
|
@@ -173,3 +169,14 @@
|
|
173
169
|
|
174
170
|
.ais-Pagination-item--selected a
|
175
171
|
background var(--efu-main)
|
172
|
+
|
173
|
+
.algolia-tips
|
174
|
+
color: var(--efu-secondtext);
|
175
|
+
margin-left: auto;
|
176
|
+
opacity: .8;
|
177
|
+
|
178
|
+
i
|
179
|
+
font-size: 18px
|
180
|
+
|
181
|
+
#algolia-search .search-dialog .ais-SearchBox-input::placeholder
|
182
|
+
opacity: .6
|
@@ -13,6 +13,8 @@
|
|
13
13
|
transition 0.3s
|
14
14
|
border-radius 8px
|
15
15
|
animation slide-in .6s ease 0s 1 normal none running
|
16
|
+
gap 16px
|
17
|
+
flex-direction: column
|
16
18
|
|
17
19
|
&:hover
|
18
20
|
border var(--style-border-hover)
|
@@ -31,14 +33,10 @@
|
|
31
33
|
.search-dialog-title
|
32
34
|
font-weight 700
|
33
35
|
color var(--efu-main)
|
34
|
-
padding 0 0 0.7rem
|
35
36
|
font-size 1.4em
|
36
37
|
line-height 1
|
37
38
|
|
38
39
|
.search-close-button
|
39
|
-
position absolute
|
40
|
-
top 0.8rem
|
41
|
-
right 1rem
|
42
40
|
color var(--efu-gray)
|
43
41
|
font-size 1.4em
|
44
42
|
line-height 1
|
@@ -77,7 +75,6 @@
|
|
77
75
|
|
78
76
|
#search-pagination
|
79
77
|
.pagination-list
|
80
|
-
margin 0.2rem 0 0
|
81
78
|
padding 0
|
82
79
|
text-align center
|
83
80
|
|
@@ -103,13 +100,13 @@
|
|
103
100
|
color var(--efu-white)
|
104
101
|
|
105
102
|
#search-tips
|
106
|
-
padding-top 12px
|
107
103
|
color var(--efu-secondtext)
|
108
104
|
right 0
|
109
105
|
margin auto
|
110
106
|
|
111
107
|
.search-result-count
|
112
108
|
color var(--efu-gray)
|
109
|
+
font-size 12px
|
113
110
|
|
114
111
|
b
|
115
112
|
color var(--efu-main)
|
@@ -119,8 +116,6 @@
|
|
119
116
|
margin 0 auto
|
120
117
|
max-width 100%
|
121
118
|
width 100%
|
122
|
-
padding-top 8px
|
123
|
-
padding-bottom 8px
|
124
119
|
|
125
120
|
input
|
126
121
|
height 100%
|
@@ -133,9 +128,9 @@
|
|
133
128
|
color var(--efu-fontcolor)
|
134
129
|
caret-color var(--efu-theme)
|
135
130
|
|
136
|
-
|
131
|
+
&::placeholder
|
137
132
|
color var(--efu-gray)
|
138
|
-
opacity .
|
133
|
+
opacity .8
|
139
134
|
|
140
135
|
#search-mask
|
141
136
|
position fixed
|
@@ -158,4 +153,9 @@
|
|
158
153
|
|
159
154
|
&:hover
|
160
155
|
background var(--efu-main)
|
161
|
-
color var(--efu-white)
|
156
|
+
color var(--efu-white)
|
157
|
+
|
158
|
+
.search-nav
|
159
|
+
display: flex
|
160
|
+
justify-content: space-between
|
161
|
+
align-content: center
|
package/source/js/main.js
CHANGED
@@ -524,9 +524,15 @@ const addHighlight = () => {
|
|
524
524
|
const createEle = (lang, item, service) => {
|
525
525
|
const fragment = document.createDocumentFragment()
|
526
526
|
if ($isShowTool) {
|
527
|
+
const captionItem = item.querySelector('figcaption')
|
528
|
+
let caption = ''
|
529
|
+
if (captionItem) {
|
530
|
+
caption = `<div class="caption">${captionItem.innerHTML}</div>`
|
531
|
+
item.removeChild(captionItem)
|
532
|
+
}
|
527
533
|
const hlTools = document.createElement('div')
|
528
534
|
hlTools.className = `highlight-tools ${expandClass}`
|
529
|
-
hlTools.innerHTML = expandEle + lang + copyEle
|
535
|
+
hlTools.innerHTML = expandEle + lang + caption + copyEle
|
530
536
|
utils.addEventListenerPjax(hlTools, 'click', ToolsFn)
|
531
537
|
fragment.appendChild(hlTools)
|
532
538
|
}
|
@@ -689,7 +695,7 @@ class tabs {
|
|
689
695
|
if (expire.time > ex) return;
|
690
696
|
const ele = document.createElement('div');
|
691
697
|
ele.className = 'expire';
|
692
|
-
ele.innerHTML = `<i class="solitude
|
698
|
+
ele.innerHTML = `<i class="solitude fas fa-circle-exclamation"></i>${expire.text_prev}${-(expire.time - ex)}${expire.text_next}`;
|
693
699
|
const articleContainer = document.getElementById('article-container');
|
694
700
|
articleContainer.insertAdjacentElement(expire.position === 'top' ? 'afterbegin' : 'beforeend', ele);
|
695
701
|
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
document.addEventListener("DOMContentLoaded", function () {
|
2
2
|
const $searchMask = document.getElementById("search-mask");
|
3
3
|
const $searchDialog = document.querySelector("#algolia-search .search-dialog");
|
4
4
|
|
5
5
|
window.openSearch = () => {
|
6
6
|
utils.animateIn($searchMask, "to_show 0.5s");
|
7
|
-
$searchDialog.style.display = "
|
7
|
+
$searchDialog.style.display = "flex";
|
8
8
|
setTimeout(() => {
|
9
9
|
document.querySelector("#algolia-search .ais-SearchBox-input").focus();
|
10
10
|
}, 100);
|
@@ -68,12 +68,14 @@ window.addEventListener("load", () => {
|
|
68
68
|
|
69
69
|
const search = instantsearch({
|
70
70
|
indexName: algolia.indexName,
|
71
|
-
searchClient: algoliasearch(algolia.appId, algolia.apiKey),
|
71
|
+
searchClient: algoliasearch.algoliasearch(algolia.appId, algolia.apiKey),
|
72
72
|
searchFunction(helper) {
|
73
73
|
if (helper.state.query) {
|
74
|
-
let innerLoading =
|
74
|
+
let innerLoading = `<div class="loading">${GLOBAL_CONFIG.lang.search.loading}</div>`;
|
75
75
|
document.getElementById("algolia-hits").innerHTML = innerLoading;
|
76
76
|
helper.search();
|
77
|
+
} else {
|
78
|
+
document.getElementById("algolia-hits").innerHTML = '';
|
77
79
|
}
|
78
80
|
},
|
79
81
|
});
|
@@ -87,9 +89,8 @@ window.addEventListener("load", () => {
|
|
87
89
|
showReset: false,
|
88
90
|
showSubmit: false,
|
89
91
|
placeholder: GLOBAL_CONFIG.lang.search.placeholder,
|
90
|
-
showLoadingIndicator:
|
91
|
-
|
92
|
-
searchAsYouType: false,
|
92
|
+
showLoadingIndicator: false,
|
93
|
+
searchAsYouType: true,
|
93
94
|
});
|
94
95
|
|
95
96
|
const hits = instantsearch.widgets.hits({
|
@@ -98,7 +99,7 @@ window.addEventListener("load", () => {
|
|
98
99
|
item(data) {
|
99
100
|
const link = data.permalink ? data.permalink : GLOBAL_CONFIG.root + data.path;
|
100
101
|
const result = data._highlightResult;
|
101
|
-
const loadingLogo = document.querySelector("#algolia-hits .
|
102
|
+
const loadingLogo = document.querySelector("#algolia-hits .loading");
|
102
103
|
if (loadingLogo) {
|
103
104
|
loadingLogo.style.display = "none";
|
104
105
|
}
|
@@ -111,7 +112,7 @@ window.addEventListener("load", () => {
|
|
111
112
|
</a>`;
|
112
113
|
},
|
113
114
|
empty: function (data) {
|
114
|
-
const loadingLogo = document.querySelector("#algolia-hits .
|
115
|
+
const loadingLogo = document.querySelector("#algolia-hits .loading");
|
115
116
|
if (loadingLogo) {
|
116
117
|
loadingLogo.style.display = "none";
|
117
118
|
}
|
@@ -136,10 +137,10 @@ window.addEventListener("load", () => {
|
|
136
137
|
scrollTo: false,
|
137
138
|
showFirstLast: false,
|
138
139
|
templates: {
|
139
|
-
first: '<i class="solitude
|
140
|
-
last: '<i class="solitude
|
141
|
-
previous: '<i class="solitude
|
142
|
-
next: '<i class="solitude
|
140
|
+
first: '<i class="solitude fas fa-angles-left"></i>',
|
141
|
+
last: '<i class="solitude fas fa-angles-right"></i>',
|
142
|
+
previous: '<i class="solitude fas fa-angle-left"></i>',
|
143
|
+
next: '<i class="solitude fas fa-angle-right"></i>',
|
143
144
|
},
|
144
145
|
cssClasses: {
|
145
146
|
root: "pagination",
|
@@ -162,7 +163,7 @@ window.addEventListener("load", () => {
|
|
162
163
|
},
|
163
164
|
});
|
164
165
|
|
165
|
-
search.addWidgets([configure, searchBox,stats, hits, pagination]);
|
166
|
+
search.addWidgets([configure, searchBox, stats, hits, pagination]);
|
166
167
|
|
167
168
|
search.start();
|
168
169
|
|
@@ -178,4 +179,4 @@ window.addEventListener("load", () => {
|
|
178
179
|
search.on("render", () => {
|
179
180
|
window.pjax.refresh(document.getElementById("algolia-hits"));
|
180
181
|
});
|
181
|
-
});
|
182
|
+
});
|
@@ -4,7 +4,7 @@ window.addEventListener("load", () => {
|
|
4
4
|
const $searchDialog = document.querySelector("#local-search .search-dialog");
|
5
5
|
window.openSearch = () => {
|
6
6
|
utils.animateIn($searchMask, "to_show 0.5s");
|
7
|
-
$searchDialog.style.display = "
|
7
|
+
$searchDialog.style.display = "flex";
|
8
8
|
setTimeout(() => {
|
9
9
|
document.querySelector("#local-search .search-box-input").focus();
|
10
10
|
}, 100);
|
@@ -101,18 +101,15 @@ window.addEventListener("load", () => {
|
|
101
101
|
function initUI() {
|
102
102
|
const $results = document.getElementById("search-results");
|
103
103
|
const $search = document.getElementById("search-input");
|
104
|
-
$search.addEventListener('
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
} else {
|
114
|
-
clearSearchResults();
|
115
|
-
}
|
104
|
+
$search.addEventListener('input', function (e) {
|
105
|
+
$results.innerHTML = '';
|
106
|
+
query = this.value.trim();
|
107
|
+
if (query !== '') {
|
108
|
+
results = search(query);
|
109
|
+
renderResults(results, currentPage);
|
110
|
+
renderPagination(results.length);
|
111
|
+
} else {
|
112
|
+
clearSearchResults();
|
116
113
|
}
|
117
114
|
});
|
118
115
|
}
|
@@ -202,4 +199,4 @@ window.addEventListener("load", () => {
|
|
202
199
|
window.addEventListener('pjax:complete', () => {
|
203
200
|
searchClickFn()
|
204
201
|
})
|
205
|
-
});
|
202
|
+
});
|