This commit is contained in:
tangly1024.com
2024-05-09 11:45:33 +08:00
parent 251aa21c7d
commit 2f42c21dbb

View File

@@ -2,11 +2,7 @@ import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import { getGlobalData, getPost, getPostBlocks } from '@/lib/db/getSiteData'
import { uploadDataToAlgolia } from '@/lib/plugins/algolia'
import {
checkSlugHasNoSlash,
checkSlugHasOneSlash,
getRecommendPost
} from '@/lib/utils/post'
import { checkSlugHasOneSlash, getRecommendPost } from '@/lib/utils/post'
import { idToUuid } from 'notion-utils'
import Slug from '..'
@@ -42,13 +38,6 @@ export async function getStaticPaths() {
// 增加一种访问路径 允许通过 [category]/[slug] 访问文章
// 例如文章slug 是 test 然后文章的分类category是 production
// 则除了 [domain]/[slug] 以外,还支持分类名访问: [domain]/[category]/[slug]
console.log(
allPages
?.filter(row => checkSlugHasNoSlash(row) && row.category)
.map(row => ({
params: { prefix: row.category, slug: row.slug }
}))
)
return {
paths: paths,