import type { Metadata } from "next"; import Link from "next/link"; import { getPost, getPosts } from "@/lib/posts"; import { notFound } from "next/navigation"; export async function generateStaticParams() { return getPosts("blog").map((p) => ({ slug: p.slug })); } export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { const { slug } = await params; const post = await getPost("blog", slug); if (!post) return {}; return { title: post.title, description: post.excerpt }; } export default async function BlogPostPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const post = await getPost("blog", slug); if (!post) notFound(); return (
← Blog'a Dön

{post.title}

{new Date(post.date).toLocaleDateString("tr-TR", { year: "numeric", month: "long", day: "numeric" })}
{post.tags.map((t) => {t})}
); }