hexo-theme-solitude 1.8.8 → 1.8.9
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 +0 -10
- package/_config.yml +3 -0
- package/layout/includes/inject/head.pug +1 -1
- package/layout/includes/widgets/post/copyright.pug +2 -2
- package/package.json +1 -1
- package/source/css/_post/copyright.styl +4 -0
- package/source/js/covercolor/api.js +0 -22
- package/source/js/covercolor/local.js +0 -22
- package/source/js/main.js +22 -0
@@ -4,17 +4,7 @@ on:
|
|
4
4
|
types: [created]
|
5
5
|
|
6
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
7
|
publish-gpr:
|
17
|
-
needs: build
|
18
8
|
runs-on: ubuntu-latest
|
19
9
|
permissions:
|
20
10
|
packages: write
|
package/_config.yml
CHANGED
@@ -330,6 +330,9 @@ post:
|
|
330
330
|
# default post copyright
|
331
331
|
copyright:
|
332
332
|
enable: true
|
333
|
+
author:
|
334
|
+
url: /about/ # 点击头像跳转地址
|
335
|
+
img: # 显示头像,不填写默认显示site_icon
|
333
336
|
license: CC BY-NC-SA 4.0
|
334
337
|
licenurl: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh
|
335
338
|
# 顶部文章简介
|
@@ -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.9",
|
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;"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- const {copyright} = theme.post.default
|
2
2
|
.post-copyright
|
3
3
|
.post-copyright__author_group
|
4
|
-
a.post-copyright__author_img(href=url_for(
|
5
|
-
img.post-copyright__author_img_front(src=theme.site.icon)
|
4
|
+
a.post-copyright__author_img(href=url_for(copyright.author.url))
|
5
|
+
img.post-copyright__author_img_front(src=copyright.author.img || theme.site.icon)
|
6
6
|
.post-copyright__author_name= config.title
|
7
7
|
.post-copyright__author_desc= config.subtitle
|
8
8
|
.post-tools#post-tools
|
package/package.json
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
+maxWidth768()
|
13
13
|
box-shadow var(--efu-shadow-border)
|
14
14
|
padding: 1rem 1.3rem;
|
15
|
+
|
15
16
|
.post-copyright__author_group
|
16
17
|
.post-copyright__author_img
|
17
18
|
width 64px
|
@@ -34,6 +35,9 @@
|
|
34
35
|
bottom 0
|
35
36
|
left 0
|
36
37
|
|
38
|
+
&:hover
|
39
|
+
transform scale(1.3)
|
40
|
+
|
37
41
|
.post-copyright__author_name
|
38
42
|
text-align center
|
39
43
|
font-size 20px
|
@@ -73,26 +73,4 @@ function setThemeColors(value, r = null, g = null, b = null) {
|
|
73
73
|
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
74
74
|
initThemeColor();
|
75
75
|
}
|
76
|
-
}
|
77
|
-
|
78
|
-
function initThemeColor() {
|
79
|
-
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
80
|
-
let themeColor;
|
81
|
-
if (currentTop > 0) {
|
82
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-card-bg');
|
83
|
-
} else if (PAGE_CONFIG.is_post) {
|
84
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-main');
|
85
|
-
} else {
|
86
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-background');
|
87
|
-
}
|
88
|
-
changeThemeColor(themeColor);
|
89
|
-
}
|
90
|
-
|
91
|
-
function changeThemeColor(color) {
|
92
|
-
if (null !== document.querySelector('meta[name="theme-color"]') && (document.querySelector('meta[name="theme-color"]').setAttribute("content", color),
|
93
|
-
document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]').setAttribute("content", color)),
|
94
|
-
window.matchMedia("(display-mode: standalone)").matches) {
|
95
|
-
const t = document.body;
|
96
|
-
t ? t.style.backgroundColor = color : console.error("document.body不存在")
|
97
|
-
}
|
98
76
|
}
|
@@ -138,26 +138,4 @@ function setThemeColors(value, r = null, g = null, b = null) {
|
|
138
138
|
document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
|
139
139
|
initThemeColor();
|
140
140
|
}
|
141
|
-
}
|
142
|
-
|
143
|
-
function initThemeColor() {
|
144
|
-
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
145
|
-
let themeColor;
|
146
|
-
if (currentTop > 0) {
|
147
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-card-bg');
|
148
|
-
} else if (PAGE_CONFIG.is_post) {
|
149
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-main');
|
150
|
-
} else {
|
151
|
-
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-background');
|
152
|
-
}
|
153
|
-
changeThemeColor(themeColor);
|
154
|
-
}
|
155
|
-
|
156
|
-
function changeThemeColor(color) {
|
157
|
-
if (null !== document.querySelector('meta[name="theme-color"]') && (document.querySelector('meta[name="theme-color"]').setAttribute("content", color),
|
158
|
-
document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]').setAttribute("content", color)),
|
159
|
-
window.matchMedia("(display-mode: standalone)").matches) {
|
160
|
-
const t = document.body;
|
161
|
-
t ? t.style.backgroundColor = color : console.error("document.body not found.")
|
162
|
-
}
|
163
141
|
}
|
package/source/js/main.js
CHANGED
@@ -137,6 +137,28 @@ const initObserver = () => {
|
|
137
137
|
}
|
138
138
|
}
|
139
139
|
|
140
|
+
function initThemeColor() {
|
141
|
+
const currentTop = window.scrollY || document.documentElement.scrollTop;
|
142
|
+
let themeColor;
|
143
|
+
if (currentTop > 0) {
|
144
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-card-bg');
|
145
|
+
} else if (PAGE_CONFIG.is_post) {
|
146
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-main');
|
147
|
+
} else {
|
148
|
+
themeColor = getComputedStyle(document.documentElement).getPropertyValue('--efu-background');
|
149
|
+
}
|
150
|
+
changeThemeColor(themeColor);
|
151
|
+
}
|
152
|
+
|
153
|
+
function changeThemeColor(color) {
|
154
|
+
if (null !== document.querySelector('meta[name="theme-color"]') && (document.querySelector('meta[name="theme-color"]').setAttribute("content", color),
|
155
|
+
document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]').setAttribute("content", color)),
|
156
|
+
window.matchMedia("(display-mode: standalone)").matches) {
|
157
|
+
const t = document.body;
|
158
|
+
t ? t.style.backgroundColor = color : console.error("document.body不存在")
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
140
162
|
class toc {
|
141
163
|
static init() {
|
142
164
|
const tocContainer = document.getElementById('card-toc')
|