import Image from "next/image"; import Link from "next/link"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { ArrowLeft, Calendar } from "lucide-react"; import { renderContent } from "@/lib/content-render"; import { getPostBySlug } from "@/lib/data"; import { buildMetadata } from "@/lib/seo"; import { BlogPostingLd } from "@/components/json-ld"; import { ContentSidebar } from "@/components/content-sidebar"; export async function generateMetadata({ params, }: { params: Promise<{ slug: string }>; }): Promise { const { slug } = await params; const post = await getPostBySlug(slug); if (!post) return { title: "Yazı bulunamadı" }; return buildMetadata(`/blog/${slug}`, { title: post.seo_title || post.title, description: post.seo_description || post.excerpt || undefined, keywords: post.tags ?? undefined, openGraph: { title: post.seo_title || post.title, description: post.seo_description || post.excerpt || undefined, images: post.seo_image || post.cover_image ? [{ url: (post.seo_image || post.cover_image) as string }] : undefined, type: "article", }, }); } export default async function BlogPostPage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; const post = await getPostBySlug(slug); if (!post || post.status !== "published") notFound(); const html = renderContent(post.content); return (
Tüm yazılar
{post.tags && post.tags.length > 0 && (
{post.tags.map((t) => ( {t} ))}
)}

{post.title}

{post.excerpt && (

{post.excerpt}

)}
{post.author && {post.author}} {post.author && post.published_at && } {post.published_at && ( {new Date(post.published_at).toLocaleDateString("tr-TR")} )}
{post.cover_image && (
{post.title}
)}
); }