add date + author to posts + dedupe headings

This commit is contained in:
Felix Roos
2024-01-14 23:39:03 +01:00
parent 98db3d37ef
commit 79f1a863b6
13 changed files with 7 additions and 24 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ type Props = CollectionEntry<'blog'>['data'];
const { post } = Astro.props;
const { Content } = await post.render();
import { format } from 'date-fns';
---
<article
@@ -12,8 +13,13 @@ const { Content } = await post.render();
>
<div class="pb-2">
<div class="md:flex justify-between">
<h1 class="mb-4" id={post.slug}>{post.title}</h1>
<h1 class="mb-4" id={post.slug}>{post.data.title}</h1>
</div>
<p class="italic p-0 m-0">
<time datetime={post.data.date.toISOString()}>
{format(post.data.date, 'MMMM yyyy')} by {post.data.author}
</time>
</p>
</div>
<div>
<Content />