From 996321a4d20156b66fc76bf0f1ec6ba3e4353c48 Mon Sep 17 00:00:00 2001 From: lew Date: Fri, 23 Jan 2026 20:57:01 +0000 Subject: [PATCH] feat: dates on blog posts, below the title --- apps/blog/src/pages/md/[slug].astro | 8 ++++++++ apps/blog/src/styles/global.css | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/apps/blog/src/pages/md/[slug].astro b/apps/blog/src/pages/md/[slug].astro index ff9be4f..1b95763 100644 --- a/apps/blog/src/pages/md/[slug].astro +++ b/apps/blog/src/pages/md/[slug].astro @@ -12,11 +12,19 @@ export async function getStaticPaths() { const { post } = Astro.props; const { Content } = await render(post); + +function formatDate(date: Date): string { + const d = String(date.getDate()).padStart(2, '0'); + const m = String(date.getMonth() + 1).padStart(2, '0'); + const y = String(date.getFullYear()).slice(-2); + return `${d}/${m}/${y}`; +} ---

{post.data.title}

+

{formatDate(post.data.date)}

diff --git a/apps/blog/src/styles/global.css b/apps/blog/src/styles/global.css index 8fc1a5b..bace6d8 100644 --- a/apps/blog/src/styles/global.css +++ b/apps/blog/src/styles/global.css @@ -4,6 +4,10 @@ body { padding: 1rem; } +h1, h2, h3, h4, h5, h6 { + margin-bottom: 0.25rem; +} + .muted { color: #888; }