Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2ab15fa
Update blog.config.js
qiuqianyuanluo Feb 23, 2025
3c9b189
Update blog.config.js
qiuqianyuanluo Feb 23, 2025
1893abf
Update blog.config.js
qiuqianyuanluo Feb 23, 2025
ad978c1
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
af8118e
Update font.config.js
qiuqianyuanluo Feb 24, 2025
78c5bf0
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
0ce8bb2
Update font.config.js
qiuqianyuanluo Feb 24, 2025
8e5af69
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
b4d8924
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
902c739
Update font.config.js
qiuqianyuanluo Feb 24, 2025
b2c4903
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
3dd959a
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
74b8a29
Update font.config.js
qiuqianyuanluo Feb 24, 2025
8bac296
Update font.config.js
qiuqianyuanluo Feb 24, 2025
07b43b4
Update font.config.js
qiuqianyuanluo Feb 24, 2025
aa77eee
Update font.config.js
qiuqianyuanluo Feb 24, 2025
24f14d9
Update blog.config.js
qiuqianyuanluo Feb 24, 2025
bf916fd
Update comment.config.js
qiuqianyuanluo Feb 24, 2025
8f0573d
Update widget.config.js
qiuqianyuanluo Feb 24, 2025
5109fde
Update font.config.js
qiuqianyuanluo Feb 24, 2025
70ed383
Update comment.config.js
qiuqianyuanluo Feb 24, 2025
aeb1f4f
Update font.config.js
qiuqianyuanluo Feb 28, 2025
14d56fa
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Mar 5, 2025
b4cd61d
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Mar 6, 2025
c034d77
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Mar 15, 2025
79d531c
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Apr 12, 2025
8d0616a
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Apr 14, 2025
e9b597e
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Apr 15, 2025
72a8c86
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user Apr 17, 2025
4b4518a
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user May 14, 2025
70a8912
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user May 20, 2025
863617d
Merge branch 'main' of https://github.com/tangly1024/NotionNext
actions-user May 23, 2025
ee3f275
upgrade NotionNext to v4.9.3
qiuqianyuanluo Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions blog.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ const BLOG = {
NOTION_PAGE_ID:
process.env.NOTION_PAGE_ID ||
'02ab3b8678004aa69e9e415905ef32a5,en:7c1d570661754c8fbc568e00a01fd70e',
THEME: process.env.NEXT_PUBLIC_THEME || 'simple', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple
THEME: process.env.NEXT_PUBLIC_THEME || 'fukasawa', // 当前主题,在themes文件夹下可找到所有支持的主题;主题名称就是文件夹名,例如 example,fukasawa,gitbook,heo,hexo,landing,matery,medium,next,nobelium,plog,simple
LANG: process.env.NEXT_PUBLIC_LANG || 'zh-CN', // e.g 'zh-CN','en-US' see /lib/lang.js for more.
SINCE: process.env.NEXT_PUBLIC_SINCE || 2021, // e.g if leave this empty, current year will be used.

PSEUDO_STATIC: process.env.NEXT_PUBLIC_PSEUDO_STATIC || false, // 伪静态路径,开启后所有文章URL都以 .html 结尾。
NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 60, // 更新缓存间隔 单位(秒);即每个页面有60秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。
NEXT_REVALIDATE_SECOND: process.env.NEXT_PUBLIC_REVALIDATE_SECOND || 5, // 更新缓存间隔 单位(秒);即每个页面有5秒的纯静态期、此期间无论多少次访问都不会抓取notion数据;调大该值有助于节省Vercel资源、同时提升访问速率,但也会使文章更新有延迟。
APPEARANCE: process.env.NEXT_PUBLIC_APPEARANCE || 'light', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式
APPEARANCE_DARK_TIME: process.env.NEXT_PUBLIC_APPEARANCE_DARK_TIME || [18, 6], // 夜间模式起至时间,false时关闭根据时间自动切换夜间模式

AUTHOR: process.env.NEXT_PUBLIC_AUTHOR || 'NotionNext', // 您的昵称 例如 tangly1024
BIO: process.env.NEXT_PUBLIC_BIO || '一个普通的干饭人🍚', // 作者简介
LINK: process.env.NEXT_PUBLIC_LINK || 'https://tangly1024.com', // 网站地址
KEYWORDS: process.env.NEXT_PUBLIC_KEYWORD || 'Notion, 博客', // 网站关键词 英文逗号隔开
AUTHOR: process.env.NEXT_PUBLIC_AUTHOR || 'Miona', // 您的昵称 例如 tangly1024
BIO: process.env.NEXT_PUBLIC_BIO || 'Miona 的地图', // 作者简介
LINK: process.env.NEXT_PUBLIC_LINK || 'https://kylinbag.top', // 网站地址
KEYWORDS: process.env.NEXT_PUBLIC_KEYWORD || '读书笔记, 博客', // 网站关键词 英文逗号隔开
BLOG_FAVICON: process.env.NEXT_PUBLIC_FAVICON || '/favicon.ico', // blog favicon 配置, 默认使用 /public/favicon.ico,支持在线图片,如 https://img.imesong.com/favicon.png
BEI_AN: process.env.NEXT_PUBLIC_BEI_AN || '', // 备案号 闽ICP备XXXXXX
BEI_AN_LINK: process.env.NEXT_PUBLIC_BEI_AN_LINK || 'https://beian.miit.gov.cn/', // 备案查询链接,如果用了萌备等备案请在这里填写
Expand Down Expand Up @@ -65,10 +65,10 @@ const BLOG = {
// 欢迎语打字效果,Hexo,Matery主题支持, 英文逗号隔开多个欢迎语。
GREETING_WORDS:
process.env.NEXT_PUBLIC_GREETING_WORDS ||
'Hi,我是一个程序员, Hi,我是一个打工人,Hi,我是一个干饭人,欢迎来到我的博客🎉',
'Hi',

// uuid重定向至 slug
UUID_REDIRECT: process.env.UUID_REDIRECT || false
}

module.exports = BLOG
module.exports = BLOG
55 changes: 17 additions & 38 deletions conf/font.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,36 @@
*/
module.exports = {
// START ************网站字体*****************
// ['font-serif','font-sans'] 两种可选,分别是衬线和无衬线: 参考 https://www.jianshu.com/p/55e410bd2115
// 后面空格隔开的font-light的字体粗细,留空是默认粗细;参考 https://www.tailwindcss.cn/docs/font-weight
FONT_STYLE: process.env.NEXT_PUBLIC_FONT_STYLE || 'font-sans font-light',
// 字体CSS 例如 https://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css
// 使用衬线字体
FONT_STYLE: process.env.NEXT_PUBLIC_FONT_STYLE || 'font-serif',
FONT_URL: [
// 'https://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css',
'https://fonts.googleapis.com/css?family=Bitter:300,400,700&display=swap',
'https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap',
'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;700&display=swap'
'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@150;350&display=swap'
],

// 字体优化配置
FONT_DISPLAY: process.env.NEXT_PUBLIC_FONT_DISPLAY || 'swap',
FONT_PRELOAD: process.env.NEXT_PUBLIC_FONT_PRELOAD || true,
FONT_SUBSET: process.env.NEXT_PUBLIC_FONT_SUBSET || 'chinese-simplified',
// 无衬线字体 例如'"LXGW WenKai"'

// 无衬线字体列表(强制使用 Noto Serif SC)
FONT_SANS: [
// '"LXGW WenKai"',
'"PingFang SC"',
'-apple-system',
'"Noto Serif SC"', // 中文优先
'-apple-system', // 苹果系统兜底
'BlinkMacSystemFont',
'"Hiragino Sans GB"',
'"Microsoft YaHei"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Segoe UI"',
'"Noto Sans SC"',
'HarmonyOS_Regular',
'"Helvetica Neue"',
'Helvetica',
'"Source Han Sans SC"',
'Arial',
'sans-serif',
'"Apple Color Emoji"'
'sans-serif' // 通用无衬线
],
// 衬线字体 例如'"LXGW WenKai"'

// 衬线字体列表
FONT_SERIF: [
// '"LXGW WenKai"',
'Bitter',
'"Noto Serif SC"',
'SimSun',
'"Times New Roman"',
'Times',
'serif',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
'"Apple Color Emoji"'
'"Noto Serif SC"', // 中文优先
'SimSun', // 宋体兜底
'"Times New Roman"', // 英文衬线
'serif' // 通用衬线
],

// 图标字体保持默认
FONT_AWESOME:
process.env.NEXT_PUBLIC_FONT_AWESOME_PATH ||
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css' // font-awesome 字体图标地址; 可选 /css/all.min.css , https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/6.0.0/css/all.min.css

'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css'
// END ************网站字体*****************
}
2 changes: 1 addition & 1 deletion conf/widget.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = {
DIFY_CHATBOT_TOKEN: process.env.NEXT_PUBLIC_DIFY_CHATBOT_TOKEN || '',

// 悬浮挂件
WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件
WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || false, // 是否显示宠物挂件
WIDGET_PET_LINK:
process.env.NEXT_PUBLIC_WIDGET_PET_LINK ||
'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models
Expand Down
20 changes: 17 additions & 3 deletions lib/db/SiteDataApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ export async function resolvePostProps({
locale,
from,
}) {
const toUuidIfString = value => {
if (typeof value !== 'string' || value.length === 0) {
return null
}
try {
return idToUuid(value)
} catch (error) {
return null
}
}

/**
* 1️⃣ 统一路径片段
*/
Expand Down Expand Up @@ -207,12 +218,15 @@ export async function resolvePostProps({
post = props?.allPages?.find(p => {
if (!p || p?.type?.includes('Menu')) return false

const pageUuid = toUuidIfString(p.id)
const fullSlugUuid = toUuidIfString(fullSlug)

return (
slugCandidates.has(p.slug) ||
slugCandidates.has(p.slug?.split('/').pop()) ||
slugCandidates.has(p.id) ||
slugCandidates.has(idToUuid(p.id)) ||
slugCandidates.has(idToUuid(fullSlug))
(pageUuid && slugCandidates.has(pageUuid)) ||
(fullSlugUuid && slugCandidates.has(fullSlugUuid))
)
})

Expand Down Expand Up @@ -991,4 +1005,4 @@ export function getNavPages({ allPages }) {
publishDate: item.publishDate,
ext: item.ext || {}
}))
}
}
17 changes: 12 additions & 5 deletions lib/db/notion/getAllPageIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ export default function getAllPageIds(collectionQuery, collectionId, collectionV
return []
}
let pageIds = []
let groupedIds = []
try {
// Notion数据库中的第几个视图用于站点展示和排序:
const groupIndex = BLOG.NOTION_INDEX || 0
if (viewIds && viewIds.length > 0) {
const ids = collectionQuery[collectionId][viewIds[groupIndex]]?.collection_group_results?.blockIds || []
if (ids) {
for (const id of ids) {
groupedIds =
collectionQuery?.[collectionId]?.[viewIds[groupIndex]]?.collection_group_results?.blockIds || []
if (groupedIds) {
for (const id of groupedIds) {
pageIds.push(id)
}
}
}
} catch (error) {
console.error('Error fetching page IDs:', ids, error);
return [];
console.error('Error fetching page IDs:', {
collectionId,
viewIds,
groupedIds,
error
})
return []
}

// 否则按照数据库原始排序
Expand Down
2 changes: 1 addition & 1 deletion lib/db/notion/getNotionConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function getConfigMapFromConfigPage(allPages) {
collection,
collectionView,
viewIds,
databaseRecordMap
pageRecordMap
)
}
// 遍历用户的表格
Expand Down