- 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)
16 lines
No EOL
336 B
Text
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 /> |