diff --git a/lib/notion/getNotionData.js b/lib/notion/getNotionData.js index 5a247f8c..91aa029e 100644 --- a/lib/notion/getNotionData.js +++ b/lib/notion/getNotionData.js @@ -182,7 +182,7 @@ export function getNavPages({ allPages }) { const allNavPages = allPages.filter(post => { return post && post?.slug && (!post?.slug?.startsWith('http')) && post?.type === 'Post' && post?.status === 'Published' }) - const result = allNavPages.map(item => ({ id: item.id, title: item.title || null, category: item.category || null, tags: item.tags || null, summary: item.summary || null, slug: item.slug })) + const result = allNavPages.map(item => ({ id: item.id, title: item.title || '', category: item.category || null, tags: item.tags || null, summary: item.summary || null, slug: item.slug })) const groupedArray = result.reduce((groups, item) => { const categoryName = item.category ? item.category.join('/') : '' // 将category转换为字符串