jalil.arfaoui.net/src/pages/post/[slug].astro
Jalil Arfaoui ae565d46ac Migration Astro v4 → v5 avec Content Layer API
- Mise à jour astro@5.17, @astrojs/tailwind@6, @astrojs/check
- Remplacement des content collections legacy par des loaders glob()
- Déplacement src/content/config.ts → src/content.config.ts
- entry.slug → entry.id, entry.render() → render(entry)
- Ajout de generateId personnalisé pour préserver les points dans les IDs des fichiers multilingues (.en, .ar)
2026-02-18 18:11:29 +01:00

16 lines
No EOL
336 B
Text

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