start of landing page, needs 2 intro paragraphs & links, also images
This commit is contained in:
49
src/app/posts/[slug]/page.tsx
Normal file
49
src/app/posts/[slug]/page.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import { getPost } from "@/lib/posts"
|
||||
import { notFound } from "next/navigation"
|
||||
import Link from "next/link"
|
||||
import { ArrowLeft } from "lucide-react"
|
||||
|
||||
interface PostPageProps {
|
||||
params: Promise<{ slug: string }>
|
||||
}
|
||||
|
||||
export default async function PostPage({ params }: PostPageProps) {
|
||||
const { slug } = await params
|
||||
const post = await getPost(slug)
|
||||
|
||||
if (!post) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-black text-white font-mono">
|
||||
<div className="container mx-auto px-4 py-20">
|
||||
<div className="max-w-4xl mx-auto">
|
||||
{/* Back button */}
|
||||
<Link
|
||||
href="/"
|
||||
className="inline-flex items-center space-x-2 text-red-400 hover:text-red-300 transition-colors mb-8"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
<span>Back to Home</span>
|
||||
</Link>
|
||||
|
||||
{/* Post header */}
|
||||
<header className="mb-12">
|
||||
<h1 className="text-4xl md:text-6xl font-bold text-red-600 mb-4">{post.title}</h1>
|
||||
{post.date && <time className="text-gray-400 text-lg">{post.date}</time>}
|
||||
{post.excerpt && <p className="text-xl text-gray-300 mt-4 leading-relaxed">{post.excerpt}</p>}
|
||||
</header>
|
||||
|
||||
{/* Post content */}
|
||||
<article className="prose prose-invert prose-red max-w-none">
|
||||
<div
|
||||
className="text-gray-300 leading-relaxed space-y-6"
|
||||
dangerouslySetInnerHTML={{ __html: post.content.replace(/\n/g, "<br />") }}
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user