feat: cover image display + date formatting + footer spacing

- PostCard: render coverImage above meta/content with lazy loading
- Post detail: render coverImage below title with lazy loading
- Format dates via toLocaleDateString (e.g. Jan 15, 2025)
- Footer top margin: mt-20 → mt-16
This commit is contained in:
2026-06-01 22:50:10 -05:00
parent 06481d0c26
commit 7a17d4c538
3 changed files with 21 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
<div className="grid grid-cols-1 lg:grid-cols-[1fr_200px] gap-8">
<article>
<header className="mb-12">
<time className="font-mono text-sm text-ink-soft">{post.date}</time>
<time className="font-mono text-sm text-ink-soft">{new Date(post.date).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })}</time>
<h1 className="heading-xl text-ink mt-3 mb-2">
{post.title}
</h1>
@@ -52,6 +52,14 @@ export default async function PostPage({ params }: { params: Promise<{ slug: str
{post.author && <span>by {post.author}</span>}
<span>{post.readingTime} min read</span>
</div>
{post.coverImage && (
<img
src={post.coverImage}
alt={post.title}
className="w-full h-64 object-cover rounded-xl my-6"
loading="lazy"
/>
)}
{post.tags.length > 0 && (
<div className="flex flex-wrap gap-2 mt-4">
{post.tags.map((tag) => (