chore(astro): upgrade to astro 6 with legacy content compatibility
This commit is contained in:
@@ -86,6 +86,10 @@ function rehypeDedupeIds() {
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
legacy: {
|
||||
collectionsBackwardsCompat: true,
|
||||
},
|
||||
|
||||
output: "static",
|
||||
trailingSlash: "always",
|
||||
site: process.env.PUBLIC_SITE ?? "http://localhost:4321",
|
||||
|
||||
1565
package-lock.json
generated
1565
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -25,11 +25,11 @@
|
||||
"ci": "CI=1 npm test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.3.13",
|
||||
"astro": "^5.18.0"
|
||||
"@astrojs/mdx": "^5.0.0",
|
||||
"astro": "^6.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/sitemap": "^3.7.0",
|
||||
"@astrojs/sitemap": "^3.7.1",
|
||||
"mammoth": "^1.11.0",
|
||||
"pagefind": "^1.4.0",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -2,12 +2,8 @@
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
// ✅ Après migration physique : collection = "archicrat-ia", slug = "chapitre-3" (sans prefix)
|
||||
const entries = await getCollection("archicrat-ia");
|
||||
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
|
||||
const href = (slug) => `/archicrat-ia/${slug}/`;
|
||||
---
|
||||
|
||||
<SiteLayout title="Essai-thèse — ArchiCraT-IA">
|
||||
@@ -15,7 +11,11 @@ const href = (slug) => `/archicrat-ia/${slug}/`;
|
||||
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={href(e.slug)}>{e.data.title}</a></li>
|
||||
<li>
|
||||
<a href={`/archicrat-ia/${String(e.id).replace(/\.(md|mdx)$/i, "")}/`}>
|
||||
{e.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
@@ -2,19 +2,19 @@
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import EditionToc from "../../components/EditionToc.astro";
|
||||
import LocalToc from "../../components/LocalToc.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, render } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("cas-ia");
|
||||
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
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
|
||||
@@ -28,7 +28,7 @@ const { Content, headings } = await entry.render();
|
||||
>
|
||||
<Fragment slot="aside">
|
||||
<EditionToc
|
||||
currentSlug={entry.slug}
|
||||
currentSlug={String(entry.id).replace(/\.(md|mdx)$/i, "")}
|
||||
collection="cas-ia"
|
||||
basePath="/cas-ia"
|
||||
label="Table des matières — Cas pratique IA"
|
||||
@@ -37,6 +37,5 @@ const { Content, headings } = await entry.render();
|
||||
</Fragment>
|
||||
|
||||
<h1>{entry.data.title}</h1>
|
||||
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
@@ -3,10 +3,7 @@ import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const entries = await getCollection("cas-ia");
|
||||
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
|
||||
const href = (slug: string) => `/cas-ia/${slug}/`;
|
||||
---
|
||||
|
||||
<SiteLayout title="Cas pratique — Gouvernance des systèmes IA">
|
||||
@@ -14,7 +11,11 @@ const href = (slug: string) => `/cas-ia/${slug}/`;
|
||||
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={href(e.slug)}>{e.data.title}</a></li>
|
||||
<li>
|
||||
<a href={`/cas-ia/${String(e.id).replace(/\.(md|mdx)$/i, "")}/`}>
|
||||
{e.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
import { getCollection, render } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("glossaire");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
params: { slug: String(entry.id).replace(/\.(md|mdx)$/i, "") },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
const { Content } = await render(entry);
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
@@ -26,4 +26,4 @@ const { Content } = await entry.render();
|
||||
<h1>{entry.data.term}</h1>
|
||||
<p><em>{entry.data.definitionShort}</em></p>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
</EditionLayout>
|
||||
@@ -5,11 +5,17 @@ import { getCollection } from "astro:content";
|
||||
const entries = await getCollection("glossaire");
|
||||
entries.sort((a, b) => a.data.term.localeCompare(b.data.term, "fr"));
|
||||
---
|
||||
|
||||
<SiteLayout title="Glossaire archicratique">
|
||||
<h1>Glossaire archicratique</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/glossaire/${e.slug}/`}>{e.data.term}</a> — <em>{e.data.definitionShort}</em></li>
|
||||
<li>
|
||||
<a href={`/glossaire/${String(e.id).replace(/\.(md|mdx)$/i, "")}/`}>
|
||||
{e.data.term}
|
||||
</a>{" "}
|
||||
— <em>{e.data.definitionShort}</em>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
</SiteLayout>
|
||||
Reference in New Issue
Block a user