fix-build-gitbut

This commit is contained in:
tangly1024
2023-07-08 14:10:45 +08:00
parent 9502ed5b7b
commit 05ccb455d0

View File

@@ -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转换为字符串