import { getPostBySlug, getAllPosts } from "@/lib/api" import { notFound } from "next/navigation" import type { Metadata } from "next" import Link from "next/link" import { ArrowLeft } from "lucide-react" import { Suspense } from "react" import { MDXContent } from "@/components/mdx-content" export function generateStaticParams() { const posts = getAllPosts() return posts.map((post) => ({ slug: post.slug, })) } export function generateMetadata({ params }: { params: { slug: string } }): Metadata { const post = getPostBySlug(params.slug) if (!post) { return { title: "Post Not Found", } } return { title: post.metadata.title, description: post.metadata.excerpt, } } export default function Post({ params }: { params: { slug: string } }) { const post = getPostBySlug(params.slug) if (!post) { notFound() } return (
Back to all posts

{post.metadata.title}

Loading content...
}>
) }