fix(url): migrate Essai-thèse to /archicrat-ia (routes + index + annotations)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
schema: 1
|
schema: 1
|
||||||
|
|
||||||
# optionnel (si présent, doit matcher le chemin du fichier)
|
# optionnel (si présent, doit matcher le chemin du fichier)
|
||||||
page: archicratie/archicrat-ia/prologue
|
page: archicrat-ia/prologue
|
||||||
|
|
||||||
paras:
|
paras:
|
||||||
p-0-d7974f88:
|
p-0-d7974f88:
|
||||||
@@ -25,11 +25,11 @@ paras:
|
|||||||
|
|
||||||
media:
|
media:
|
||||||
- type: "image"
|
- type: "image"
|
||||||
src: "/public/media/archicratie/archicrat-ia/prologue/p-0-d7974f88/schema-1.svg"
|
src: "/public/media/archicrat-ia/prologue/p-0-d7974f88/schema-1.svg"
|
||||||
caption: "Tableau explicatif"
|
caption: "Tableau explicatif"
|
||||||
credit: "ChatGPT"
|
credit: "ChatGPT"
|
||||||
- type: "image"
|
- type: "image"
|
||||||
src: "/public/media/archicratie/archicrat-ia/prologue/p-0-d7974f88/schema-2.svg"
|
src: "/public/media/archicrat-ia/prologue/p-0-d7974f88/schema-2.svg"
|
||||||
caption: "Diagramme d’évolution"
|
caption: "Diagramme d’évolution"
|
||||||
credit: "Yanis Varoufakis"
|
credit: "Yanis Varoufakis"
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ paras:
|
|||||||
|
|
||||||
media:
|
media:
|
||||||
- type: "video"
|
- type: "video"
|
||||||
src: "/media/prologue/p-1-2ef25f29/bien_commun.mp4"
|
src: "/public/media/archicrat-ia/prologue/p-1-2ef25f29/bien_commun.mp4"
|
||||||
caption: "Entretien avec Bernard Lahire"
|
caption: "Entretien avec Bernard Lahire"
|
||||||
credit: "Cairn.info"
|
credit: "Cairn.info"
|
||||||
|
|
||||||
@@ -5,9 +5,12 @@ import EditionToc from "../../components/EditionToc.astro";
|
|||||||
import LocalToc from "../../components/LocalToc.astro";
|
import LocalToc from "../../components/LocalToc.astro";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const entries = await getCollection("archicratie");
|
const entries = (await getCollection("archicratie"))
|
||||||
|
.filter((e) => e.slug.startsWith("archicrat-ia/"));
|
||||||
|
|
||||||
return entries.map((entry) => ({
|
return entries.map((entry) => ({
|
||||||
params: { slug: entry.slug },
|
// ✅ inline : jamais de helper externe (évite "stripPrefix is not defined")
|
||||||
|
params: { slug: entry.slug.replace(/^archicrat-ia\//, "") },
|
||||||
props: { entry },
|
props: { entry },
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -18,10 +21,10 @@ const { Content, headings } = await entry.render();
|
|||||||
|
|
||||||
<EditionLayout
|
<EditionLayout
|
||||||
title={entry.data.title}
|
title={entry.data.title}
|
||||||
editionLabel="Archicratie"
|
editionLabel="Essai-thèse"
|
||||||
editionKey="archicratie"
|
editionKey="archicrat-ia"
|
||||||
statusLabel="modèle sociopolitique"
|
statusLabel="essai-thèse"
|
||||||
statusKey="modele_sociopolitique"
|
statusKey="essai_these"
|
||||||
level={entry.data.level}
|
level={entry.data.level}
|
||||||
version={entry.data.version}
|
version={entry.data.version}
|
||||||
>
|
>
|
||||||
|
|||||||
22
src/pages/archicrat-ia/index.astro
Normal file
22
src/pages/archicrat-ia/index.astro
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||||
|
import { getCollection } from "astro:content";
|
||||||
|
|
||||||
|
const entries = (await getCollection("archicratie"))
|
||||||
|
.filter((e) => e.slug.startsWith("archicrat-ia/"));
|
||||||
|
|
||||||
|
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||||
|
|
||||||
|
const strip = (slug) => slug.replace(/^archicrat-ia\//, "");
|
||||||
|
const href = (slug) => `/archicrat-ia/${strip(slug)}/`;
|
||||||
|
---
|
||||||
|
|
||||||
|
<SiteLayout title="Essai-thèse — ArchiCraT-IA">
|
||||||
|
<h1>Essai-thèse — ArchiCraT-IA</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{entries.map((e) => (
|
||||||
|
<li><a href={href(e.slug)}>{e.data.title}</a></li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</SiteLayout>
|
||||||
@@ -5,7 +5,8 @@ import EditionToc from "../../components/EditionToc.astro";
|
|||||||
import LocalToc from "../../components/LocalToc.astro";
|
import LocalToc from "../../components/LocalToc.astro";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const entries = await getCollection("archicratie");
|
const entries = (await getCollection("archicratie"))
|
||||||
|
.filter((e) => !e.slug.startsWith("archicrat-ia/"));
|
||||||
return entries.map((entry) => ({
|
return entries.map((entry) => ({
|
||||||
params: { slug: entry.slug },
|
params: { slug: entry.slug },
|
||||||
props: { entry },
|
props: { entry },
|
||||||
|
|||||||
Reference in New Issue
Block a user