chore(astro): upgrade to astro 6 with legacy content compatibility
This commit is contained in:
@@ -1,34 +1,38 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import EditionToc from "../../components/EditionToc.astro";
|
||||
import LocalToc from "../../components/LocalToc.astro";
|
||||
import { getCollection, render } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
// ✅ Après migration : plus de filtre par prefix, on prend toute la collection
|
||||
const entries = await getCollection("archicrat-ia");
|
||||
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
params: { slug: String(entry.id).replace(/\.(md|mdx)$/i, "") },
|
||||
props: { entry }
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content, headings } = await entry.render();
|
||||
const { Content, headings } = await render(entry);
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Essai-thèse"
|
||||
editionKey="archicrat-ia"
|
||||
statusLabel="essai-thèse"
|
||||
statusLabel="Essai-thèse"
|
||||
statusKey="essai_these"
|
||||
level={entry.data.level}
|
||||
level={entry.data.level ?? 1}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<Fragment slot="aside">
|
||||
<EditionToc currentSlug={entry.slug} />
|
||||
<EditionToc
|
||||
currentSlug={String(entry.id).replace(/\.(md|mdx)$/i, "")}
|
||||
collection="archicrat-ia"
|
||||
basePath="/archicrat-ia"
|
||||
label="Table des matières — ArchiCraT-IA"
|
||||
/>
|
||||
<LocalToc headings={headings} />
|
||||
</Fragment>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user