Skip to content

Commit f4d656b

Browse files
fix 404 page
1 parent ccbd7d4 commit f4d656b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/[...slug]/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { allPages } from 'contentlayer/generated'
88
import type { Pages } from 'contentlayer/generated'
99
import siteMetadata from '@/data/siteMetadata'
1010
import { components } from '@/components/markdown/MDXComponents'
11+
import { notFound } from 'next/navigation'
1112

1213
import PageLayout from '@/layouts/posts/PageLayout'
1314
const defaultLayout = 'PageLayout'
@@ -24,7 +25,7 @@ export async function generateMetadata({
2425
const page = allPages.find((p) => p.slug === slug)
2526

2627
if (!page) {
27-
return
28+
return notFound()
2829
}
2930
let imageList = [siteMetadata.socialBanner]
3031
if (page.image) {

0 commit comments

Comments
 (0)