feat: add md slug page for individual posts

This commit is contained in:
Lewis Wynne 2026-01-23 19:19:05 +00:00
parent b71a780ef8
commit 6ef5b3a413

View file

@ -0,0 +1,22 @@
---
import { getCollection, render } from 'astro:content';
import Layout from '../../layouts/Layout.astro';
export async function getStaticPaths() {
const posts = await getCollection('posts');
return posts.map(post => ({
params: { slug: post.id },
props: { post }
}));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<Layout title={`${post.data.title} - lewis m.w.`}>
<article>
<h1>{post.data.title}</h1>
<Content />
</article>
</Layout>