hexo-theme-solitude 1.8.7 → 1.8.8
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/workflows/github-publish.yml +30 -0
- package/.github/workflows/{publish.yml → npm-publish.yml} +2 -3
- package/_config.yml +7 -7
- package/layout/includes/inject/body.pug +1 -1
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/post/postMeta.pug +1 -1
- package/layout/includes/widgets/third-party/comments/comment.pug +1 -1
- package/package.json +1 -1
- package/plugins.yml +3 -3
- package/source/css/_layout/article-container.styl +0 -3
- package/source/js/main.js +28 -35
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Node.js Package
|
2
|
+
on:
|
3
|
+
release:
|
4
|
+
types: [created]
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v4
|
11
|
+
- uses: actions/setup-node@v4
|
12
|
+
with:
|
13
|
+
node-version: 16
|
14
|
+
- run: npm test
|
15
|
+
|
16
|
+
publish-gpr:
|
17
|
+
needs: build
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
permissions:
|
20
|
+
packages: write
|
21
|
+
contents: read
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v4
|
24
|
+
- uses: actions/setup-node@v4
|
25
|
+
with:
|
26
|
+
node-version: 16
|
27
|
+
registry-url: https://npm.pkg.github.com/
|
28
|
+
- run: npm publish
|
29
|
+
env:
|
30
|
+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
package/_config.yml
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Author: Valor Team
|
4
4
|
# Github: https://github.com/valor-x/hexo-theme-solitude
|
5
5
|
#
|
6
|
-
# 配置指南: https://
|
6
|
+
# 配置指南: https://docs.efu.me/
|
7
7
|
# 你可以从指南中获得更详细的说明
|
8
8
|
#
|
9
|
-
# Guide: https://
|
9
|
+
# Guide: https://docs.efu.me/
|
10
10
|
# You can get more detailed help from the guide
|
11
11
|
#
|
12
12
|
# 赞助:https://afdian.net/a/efu0u0
|
@@ -130,7 +130,7 @@ hometop:
|
|
130
130
|
title: Solitude 主题文档
|
131
131
|
# 点击跳转链接
|
132
132
|
# Click the jump link
|
133
|
-
url: https://
|
133
|
+
url: https://docs.efu.me/
|
134
134
|
# 显示背景图片
|
135
135
|
# Display background image
|
136
136
|
img: /img/default.png
|
@@ -701,7 +701,7 @@ post_ai:
|
|
701
701
|
|
702
702
|
# latex 公式支持
|
703
703
|
# latex formula support
|
704
|
-
# docs: https://
|
704
|
+
# docs: https://docs.efu.me/configuration/extra#数学公式
|
705
705
|
katex:
|
706
706
|
enable: false
|
707
707
|
per_page: false # 是否在每页都加载 / Whether to load on each page
|
@@ -709,12 +709,13 @@ katex:
|
|
709
709
|
|
710
710
|
# 评论
|
711
711
|
# comment
|
712
|
-
# getting start: http://
|
712
|
+
# getting start: http://docs.efu.me/comments/comment
|
713
713
|
comment:
|
714
714
|
use: # waline, twikoo, valine, artalk
|
715
715
|
commentBarrage: false # 热评开关 / Hot comment switch
|
716
716
|
lazyload: false # 懒加载
|
717
717
|
count: false # 评论数展示
|
718
|
+
pv: false # 是否使用評論統計頁面訪問
|
718
719
|
avatar: https://cravatar.cn # Gravatar link
|
719
720
|
newest_comment:
|
720
721
|
enable: false
|
@@ -794,7 +795,7 @@ extends:
|
|
794
795
|
|
795
796
|
# PWA
|
796
797
|
# https://developer.mozilla.org/zh-CN/docs/Web/Progressive_web_apps
|
797
|
-
# docs: https://
|
798
|
+
# docs: https://docs.efu.me/configuration/extra#pwa
|
798
799
|
pwa:
|
799
800
|
enable: false
|
800
801
|
manifest: /manifest.json # manifest.json 文件路径
|
@@ -875,7 +876,6 @@ CDN:
|
|
875
876
|
|
876
877
|
option:
|
877
878
|
solitude_css: https://cdn2.codesign.qq.com/icons/7pOrz0WXB5ZWJPX/latest/iconfont.css
|
878
|
-
busuanzi_js: https://pv.lemonso.com/js # 青秸的 Busanzi,相比较官方更稳定、快速
|
879
879
|
# algolia_search:
|
880
880
|
# instantsearch:
|
881
881
|
# pjax:
|
@@ -96,7 +96,7 @@ div
|
|
96
96
|
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".bber-content-img img"));
|
97
97
|
sco.changeTimeFormat(document.querySelectorAll('.bber-info-time time'))
|
98
98
|
if theme.busuanzi && (theme.aside.siteinfo.uv || theme.aside.siteinfo.pv)
|
99
|
-
script(
|
99
|
+
script(defer pjax src=url_for(theme.cdn.busuanzi_js))
|
100
100
|
|
101
101
|
|
102
102
|
if theme.footer.randomlink
|
@@ -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.8.
|
30
|
+
"%c Program: Hexo %c Theme: Solitude %c Version: v1.8.8",
|
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
|
"border-radius:0 5px 5px 0;padding: 5px 10px;background:#0084ff;color:white;"
|
@@ -40,7 +40,7 @@
|
|
40
40
|
if theme.post.meta.pv
|
41
41
|
a.post-meta-pv(href=url_for(page.path), title=_p('post.pv'))
|
42
42
|
i.post-meta-icon.solitude.st-fire-fill
|
43
|
-
if theme.comment.use
|
43
|
+
if theme.comment.use && theme.comment.pv
|
44
44
|
case theme.comment.use[0]
|
45
45
|
when "Twikoo"
|
46
46
|
span#twikoo_visitors
|
package/package.json
CHANGED
package/plugins.yml
CHANGED
@@ -78,9 +78,9 @@ swiper_js:
|
|
78
78
|
version: 11.0.5
|
79
79
|
other_name: Swiper
|
80
80
|
busuanzi_js:
|
81
|
-
name: busuanzi
|
82
|
-
file: bsz.pure.
|
83
|
-
version:
|
81
|
+
name: pearssauce-busuanzi
|
82
|
+
file: bsz.pure.min.js
|
83
|
+
version: 1.0.0
|
84
84
|
snackbar:
|
85
85
|
name: node-snackbar
|
86
86
|
file: dist/snackbar.min.js
|
package/source/js/main.js
CHANGED
@@ -37,14 +37,12 @@ const sidebarFn = () => {
|
|
37
37
|
const scrollFn = function () {
|
38
38
|
const innerHeight = window.innerHeight;
|
39
39
|
if (document.body.scrollHeight <= innerHeight) return;
|
40
|
-
|
41
40
|
let initTop = 0;
|
42
41
|
const $header = document.getElementById('page-header');
|
43
|
-
|
44
|
-
initThemeColor()
|
42
|
+
const throttledScroll = utils.throttle(function (e) {
|
43
|
+
initThemeColor();
|
45
44
|
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
46
45
|
const isDown = scrollDirection(currentTop);
|
47
|
-
|
48
46
|
if (currentTop > 0) {
|
49
47
|
if (isDown) {
|
50
48
|
if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible');
|
@@ -53,12 +51,15 @@ const scrollFn = function () {
|
|
53
51
|
}
|
54
52
|
$header.classList.add('nav-fixed');
|
55
53
|
} else {
|
56
|
-
if (currentTop ===0){
|
57
54
|
$header.classList.remove('nav-fixed', 'nav-visible');
|
58
|
-
}
|
59
55
|
}
|
60
|
-
}, 200)
|
61
|
-
|
56
|
+
}, 200);
|
57
|
+
window.addEventListener('scroll', function(e) {
|
58
|
+
throttledScroll(e);
|
59
|
+
if (window.scrollY === 0) {
|
60
|
+
$header.classList.remove('nav-fixed', 'nav-visible');
|
61
|
+
}
|
62
|
+
});
|
62
63
|
function scrollDirection(currentTop) {
|
63
64
|
const result = currentTop > initTop;
|
64
65
|
initTop = currentTop;
|
@@ -67,34 +68,26 @@ const scrollFn = function () {
|
|
67
68
|
}
|
68
69
|
|
69
70
|
const percent = () => {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
const docEl = document.documentElement;
|
72
|
+
const body = document.body;
|
73
|
+
const scrollPos = window.pageYOffset || docEl.scrollTop;
|
74
|
+
const scrollHeight = Math.max(body.scrollHeight, docEl.scrollHeight, body.offsetHeight, docEl.offsetHeight, body.clientHeight, docEl.clientHeight);
|
75
|
+
const viewportHeight = docEl.clientHeight;
|
76
|
+
const totalScrollableHeight = scrollHeight - viewportHeight;
|
77
|
+
const scrolledPercent = Math.round((scrollPos / totalScrollableHeight) * 100);
|
78
|
+
const navToTop = document.querySelector("#nav-totop");
|
79
|
+
const percentDisplay = document.querySelector("#percent");
|
80
|
+
const commentOrFooter = document.getElementById("post-comment") || document.getElementById("footer");
|
81
|
+
const isNearEnd = (window.scrollY + viewportHeight) >= commentOrFooter.offsetTop;
|
82
|
+
if (isNearEnd || scrolledPercent > 90) {
|
83
|
+
navToTop.classList.add("long");
|
84
|
+
percentDisplay.textContent = GLOBAL_CONFIG.lang.backtop;
|
80
85
|
} else {
|
81
|
-
|
82
|
-
|
83
|
-
percentElement.innerHTML = scrollPercent + ""
|
84
|
-
}
|
86
|
+
navToTop.classList.remove("long");
|
87
|
+
percentDisplay.textContent = scrolledPercent;
|
85
88
|
}
|
86
|
-
|
87
|
-
|
88
|
-
if (remainingScroll < 100) {
|
89
|
-
elementsToHide.forEach(function (element) {
|
90
|
-
element.classList.add("hide")
|
91
|
-
})
|
92
|
-
} else {
|
93
|
-
elementsToHide.forEach(function (element) {
|
94
|
-
element.classList.remove("hide")
|
95
|
-
})
|
96
|
-
}
|
97
|
-
|
89
|
+
const elementsToHide = document.querySelectorAll(".needEndHide");
|
90
|
+
elementsToHide.forEach(item => item.classList.toggle("hide", totalScrollableHeight - scrollPos < 100));
|
98
91
|
window.onscroll = percent
|
99
92
|
}
|
100
93
|
|
@@ -892,12 +885,12 @@ window.refreshFn = () => {
|
|
892
885
|
|
893
886
|
document.addEventListener('DOMContentLoaded', function () {
|
894
887
|
sco.initAdjust()
|
895
|
-
percent()
|
896
888
|
initObserver()
|
897
889
|
addCopyright()
|
898
890
|
sco.initConsoleState()
|
899
891
|
window.refreshFn()
|
900
892
|
asideStatus()
|
893
|
+
percent()
|
901
894
|
})
|
902
895
|
|
903
896
|
window.onkeydown = function (e) {
|