mirror of
https://github.com/shadcn-ui/taxonomy
synced 2026-05-23 09:18:30 +00:00
fix: handle not found errors for posts
This commit is contained in:
parent
9b08f1051c
commit
fc33828afc
1 changed files with 6 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { notFound } from "next/navigation"
|
||||
|
||||
import { Blog } from "@/lib/mdx/sources"
|
||||
import { MdxContent } from "@/components/mdx-content"
|
||||
import { formatDate } from "@/lib/utils"
|
||||
|
|
@ -21,6 +23,10 @@ export async function generateStaticParams() {
|
|||
export default async function PostPage({ params }) {
|
||||
const post = await Blog.getMdxNode(params?.slug?.join("/"))
|
||||
|
||||
if (!post) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
return (
|
||||
<article className="mx-auto max-w-2xl py-12">
|
||||
<div className="flex flex-col space-y-2">
|
||||
|
|
|
|||
Loading…
Reference in a new issue