aria.coffee/src/pages/posts/[...slug].astro
2024-12-19 11:53:42 +11:00

18 lines
No EOL
460 B
Text

---
import { getCollection, render } from "astro:content";
import MarkdownPostLayout from "../../layouts/MarkdownPostLayout.astro";
export async function getStaticPaths() {
const posts = await getCollection("blog");
return posts.map((post) => ({
params: { slug: post.id },
props: { post },
}));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<MarkdownPostLayout frontmatter={post.data}>
<Content />
</MarkdownPostLayout>