Prism微调

This commit is contained in:
tangly
2022-11-19 10:39:17 +08:00
parent 81a85f273c
commit dc0fb15e22
3 changed files with 45 additions and 33 deletions

View File

@@ -105,7 +105,11 @@ export async function getStaticProps({ params: { slug } }) {
})
if (!props.post) {
const post = await getNotion(slug.slice(-1)[0])
const pageId = slug.slice(-1)[0]
if (pageId.length < 32) {
return { props, revalidate: 1 }
}
const post = await getNotion(pageId)
if (post) {
props.post = post
} else {