jalil.arfaoui.net/src/pages/post/[slug].astro

16 lines
No EOL
331 B
Text

---
import { getCollection } from "astro:content";
export async function getStaticPaths() {
const postEntries = await getCollection("blog");
return postEntries.map((entry) => ({
params: { slug: entry.slug },
props: { entry },
}));
}
const { entry } = Astro.props;
const { Content } = await entry.render();
---
<Content />