Skip to content

Commit 95f2bb9

Browse files
authored
Merge branch 'tangly1024:main' into main
2 parents 5057571 + 6c984fb commit 95f2bb9

8 files changed

Lines changed: 221 additions & 51 deletions

File tree

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NOTION_PAGE_ID
22
ARG NEXT_PUBLIC_THEME
33

4-
FROM node:18-alpine3.18 AS base
4+
FROM node:20-alpine AS base
55

66
# 1. Install dependencies only when needed
77
FROM base AS deps

conf/comment.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
process.env.NEXT_PUBLIC_COMMENT_TWIKOO_COUNT_ENABLE || false, // 博客列表是否显示评论数
2222
COMMENT_TWIKOO_CDN_URL:
2323
process.env.NEXT_PUBLIC_COMMENT_TWIKOO_CDN_URL ||
24-
'https://cdn.jsdelivr.net/npm/twikoo@1.6.17/dist/twikoo.all.min.js', // twikoo客户端cdn
24+
'https://cdn.jsdelivr.net/npm/twikoo@1.6.42/dist/twikoo.all.min.js', // twikoo客户端cdn
2525

2626
// utterance
2727
COMMENT_UTTERRANCES_REPO:

lib/notion/getPostBlocks.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ function convertNotionBlocksToPost(id, blockMap, slice) {
139139

140140
// 如果是文件,或嵌入式PDF,需要重新加密签名
141141
if (
142-
(b?.value?.type === 'file' ||
143-
b?.value?.type === 'pdf' ||
144-
b?.value?.type === 'video' ||
145-
b?.value?.type === 'audio') &&
146-
b?.value?.properties?.source?.[0][0]
142+
['file', 'pdf', 'video', 'audio'].includes(b?.value?.type) &&
143+
b?.value?.properties?.source?.[0][0] &&
144+
(b?.value?.properties?.source?.[0][0].indexOf('attachment') === 0 ||
145+
b?.value?.properties?.source?.[0][0].indexOf('amazonaws.com') > 0)
147146
) {
148147
const oldUrl = b?.value?.properties?.source?.[0][0]
149148
const newUrl = `https://notion.so/signed/${encodeURIComponent(oldUrl)}?table=block&id=${b?.value?.id}`

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "4.8.4",
44
"homepage": "https://github.com/tangly1024/NotionNext.git",
55
"license": "MIT",
6+
"engines": {
7+
"node": ">=20"
8+
},
69
"repository": {
710
"type": "git",
811
"url": "https://github.com/tangly1024/NotionNext.git"

themes/hexo/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const CONFIG = {
3939
HEXO_WIDGET_TO_TOP: true,
4040
HEXO_WIDGET_TO_COMMENT: true, // 跳到评论区
4141
HEXO_WIDGET_DARK_MODE: true, // 夜间模式
42-
HEXO_WIDGET_TOC: true // 移动端悬浮目录
42+
HEXO_WIDGET_TOC: true, // 移动端悬浮目录
43+
44+
HEXO_THEME_COLOR: '#928CEE' // 主题色配置(默认为 #928CEE)
4345
}
4446
export default CONFIG

themes/hexo/style.js

Lines changed: 207 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,240 @@
11
/* eslint-disable react/no-unknown-property */
2+
import { siteConfig } from '@/lib/config'
3+
import CONFIG from './config'
4+
25
/**
36
* 这里的css样式只对当前主题生效
47
* 主题客制化css
58
* @returns
69
*/
710
const Style = () => {
8-
return (<style jsx global>{`
9-
// 底色
10-
body{
11-
background-color: #f5f5f5
12-
}
13-
.dark body{
11+
// 从配置中获取主题色,如果没有配置则使用默认值 #928CEE
12+
const themeColor = siteConfig('HEXO_THEME_COLOR', '#928CEE', CONFIG)
13+
14+
return (
15+
<style jsx global>{`
16+
:root {
17+
--theme-color: ${themeColor};
18+
}
19+
20+
// 底色
21+
#theme-hexo body {
22+
background-color: #f5f5f5;
23+
}
24+
.dark #theme-hexo body {
1425
background-color: black;
15-
}
16-
17-
/* 菜单下划线动画 */
18-
#theme-hexo .menu-link {
26+
}
27+
28+
/* 菜单下划线动画 */
29+
#theme-hexo .menu-link {
1930
text-decoration: none;
20-
background-image: linear-gradient(#928CEE, #928CEE);
31+
background-image: linear-gradient(
32+
var(--theme-color),
33+
var(--theme-color)
34+
);
2135
background-repeat: no-repeat;
2236
background-position: bottom center;
2337
background-size: 0 2px;
2438
transition: background-size 100ms ease-in-out;
25-
}
26-
27-
#theme-hexo .menu-link:hover {
39+
}
40+
41+
#theme-hexo .menu-link:hover {
2842
background-size: 100% 2px;
29-
color: #928CEE;
30-
}
43+
color: var(--theme-color);
44+
}
45+
46+
/* 文章列表中标题行悬浮时的文字颜色 */
47+
#theme-hexo h2:hover .menu-link {
48+
color: var(--theme-color) !important;
49+
}
50+
.dark #theme-hexo h2:hover .menu-link {
51+
color: var(--theme-color) !important;
52+
}
53+
54+
/* 下拉菜单悬浮背景色 */
55+
#theme-hexo li[class*='hover:bg-indigo-500']:hover {
56+
background-color: var(--theme-color) !important;
57+
}
58+
59+
/* tag标签悬浮背景色 */
60+
#theme-hexo a[class*='hover:bg-indigo-400']:hover {
61+
background-color: var(--theme-color) !important;
62+
}
63+
64+
/* 社交按钮悬浮颜色 */
65+
#theme-hexo i[class*='hover:text-indigo-600']:hover {
66+
color: var(--theme-color) !important;
67+
}
68+
.dark #theme-hexo i[class*='dark:hover:text-indigo-400']:hover {
69+
color: var(--theme-color) !important;
70+
}
3171
32-
/* 设置了从上到下的渐变黑色 */
33-
#theme-hexo .header-cover::before {
34-
content: "";
72+
/* MenuGroup 悬浮颜色 */
73+
#theme-hexo #nav div[class*='hover:text-indigo-600']:hover {
74+
color: var(--theme-color) !important;
75+
}
76+
.dark #theme-hexo #nav div[class*='dark:hover:text-indigo-400']:hover {
77+
color: var(--theme-color) !important;
78+
}
79+
80+
/* 最新发布文章悬浮颜色 */
81+
#theme-hexo div[class*='hover:text-indigo-600']:hover,
82+
#theme-hexo div[class*='hover:text-indigo-400']:hover {
83+
color: var(--theme-color) !important;
84+
}
85+
86+
/* 分页组件颜色 */
87+
#theme-hexo .text-indigo-400 {
88+
color: var(--theme-color) !important;
89+
}
90+
#theme-hexo .border-indigo-400 {
91+
border-color: var(--theme-color) !important;
92+
}
93+
#theme-hexo a[class*='hover:bg-indigo-400']:hover {
94+
background-color: var(--theme-color) !important;
95+
color: white !important;
96+
}
97+
/* 移动设备下,搜索组件中选中分类的高亮背景色 */
98+
#theme-hexo div[class*='hover:bg-indigo-400']:hover {
99+
background-color: var(--theme-color) !important;
100+
}
101+
#theme-hexo .hover\:bg-indigo-400:hover {
102+
background-color: var(--theme-color) !important;
103+
}
104+
#theme-hexo .bg-indigo-400 {
105+
background-color: var(--theme-color) !important;
106+
}
107+
#theme-hexo a[class*='hover:bg-indigo-600']:hover {
108+
background-color: var(--theme-color) !important;
109+
color: white !important;
110+
}
111+
112+
/* 右下角悬浮按钮背景色 */
113+
#theme-hexo .bg-indigo-500 {
114+
background-color: var(--theme-color) !important;
115+
}
116+
.dark #theme-hexo .dark\:bg-indigo-500 {
117+
background-color: var(--theme-color) !important;
118+
}
119+
/* 移动设备菜单栏背景色 */
120+
#theme-hexo .hover\:bg-indigo-500:hover {
121+
background-color: var(--theme-color) !important;
122+
}
123+
.dark #theme-hexo .dark\:hover\:bg-indigo-500:hover {
124+
background-color: var(--theme-color) !important;
125+
}
126+
127+
/* 文章浏览进度条颜色 */
128+
#theme-hexo .bg-indigo-600 {
129+
background-color: var(--theme-color) !important;
130+
}
131+
/* 当前浏览位置标题高亮颜色 */
132+
#theme-hexo .border-indigo-800 {
133+
border-color: var(--theme-color) !important;
134+
}
135+
#theme-hexo .text-indigo-800 {
136+
color: var(--theme-color) !important;
137+
}
138+
.dark #theme-hexo .dark\:text-indigo-400 {
139+
color: var(--theme-color) !important;
140+
}
141+
.dark #theme-hexo .dark\:border-indigo-400 {
142+
border-color: var(--theme-color) !important;
143+
}
144+
.dark #theme-hexo .dark\:border-white {
145+
border-color: var(--theme-color) !important;
146+
}
147+
/* 目录项悬浮时的字体颜色 */
148+
#theme-hexo a[class*='hover:text-indigo-800']:hover {
149+
color: var(--theme-color) !important;
150+
}
151+
/* 深色模式下目录项的默认文字颜色和边框线颜色 */
152+
.dark #theme-hexo .catalog-item {
153+
color: white !important;
154+
border-color: white !important;
155+
}
156+
.dark #theme-hexo .catalog-item:hover {
157+
color: var(--theme-color) !important;
158+
}
159+
/* 深色模式下当前高亮标题的边框线颜色 */
160+
.dark #theme-hexo .catalog-item.font-bold {
161+
border-color: var(--theme-color) !important;
162+
}
163+
164+
/* 文章底部版权声明组件左侧边框线颜色 */
165+
#theme-hexo .border-indigo-500 {
166+
border-color: var(--theme-color) !important;
167+
}
168+
169+
/* 归档页面文章列表项悬浮时左侧边框线颜色 */
170+
#theme-hexo li[class*='hover:border-indigo-500']:hover {
171+
border-color: var(--theme-color) !important;
172+
}
173+
174+
/* 自定义右键菜单悬浮高亮颜色 */
175+
#theme-hexo .hover\:bg-blue-600:hover {
176+
background-color: var(--theme-color) !important;
177+
}
178+
.dark #theme-hexo li[class*='dark:hover:border-indigo-300']:hover {
179+
border-color: var(--theme-color) !important;
180+
}
181+
/* 深色模式下,归档页面文章列表项默认状态左侧边框线颜色 */
182+
.dark #theme-hexo li[class*='dark:border-indigo-400'] {
183+
border-color: var(--theme-color) !important;
184+
}
185+
/* 深色模式下,归档页面文章标题悬浮时的文字颜色 */
186+
.dark #theme-hexo a[class*='dark:hover:text-indigo-300']:hover {
187+
color: var(--theme-color) !important;
188+
}
189+
190+
/* 设置了从上到下的渐变黑色 */
191+
#theme-hexo .header-cover::before {
192+
content: '';
35193
position: absolute;
36194
top: 0;
37195
left: 0;
38196
width: 100%;
39197
height: 100%;
40-
background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%);
41-
}
198+
background: linear-gradient(
199+
to bottom,
200+
rgba(0, 0, 0, 0.5) 0%,
201+
rgba(0, 0, 0, 0.2) 10%,
202+
rgba(0, 0, 0, 0) 25%,
203+
rgba(0, 0, 0, 0.2) 75%,
204+
rgba(0, 0, 0, 0.5) 100%
205+
);
206+
}
42207
43-
/* Custem */
44-
.tk-footer{
208+
/* Custem */
209+
.tk-footer {
45210
opacity: 0;
46-
}
211+
}
47212
48-
// 选中字体颜色
49-
::selection {
50-
background: rgba(45, 170, 219, 0.3);
51-
}
213+
// 选中字体颜色
214+
::selection {
215+
background: color-mix(in srgb, var(--theme-color) 30%, transparent);
216+
}
52217
53-
// 自定义滚动条
54-
::-webkit-scrollbar {
218+
// 自定义滚动条
219+
::-webkit-scrollbar {
55220
width: 5px;
56221
height: 5px;
57-
}
222+
}
58223
59-
::-webkit-scrollbar-track {
224+
::-webkit-scrollbar-track {
60225
background: transparent;
61-
}
62-
63-
::-webkit-scrollbar-thumb {
64-
background-color: #49b1f5;
65-
}
226+
}
66227
67-
* {
68-
scrollbar-width:thin;
69-
scrollbar-color: #49b1f5 transparent
70-
}
71-
228+
::-webkit-scrollbar-thumb {
229+
background-color: var(--theme-color);
230+
}
72231
73-
`}</style>)
232+
* {
233+
scrollbar-width: thin;
234+
scrollbar-color: var(--theme-color) transparent;
235+
}
236+
`}</style>
237+
)
74238
}
75239

76240
export { Style }

0 commit comments

Comments
 (0)