chore: track site sources + ignore local env/backups
This commit is contained in:
22
src/pages/api/glossaire.json.ts
Normal file
22
src/pages/api/glossaire.json.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { APIRoute } from "astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
export const GET: APIRoute = async () => {
|
||||
const entries = await getCollection("glossaire");
|
||||
const index = entries.map((e) => ({
|
||||
slug: e.slug,
|
||||
term: e.data.term,
|
||||
aliases: e.data.aliases ?? [],
|
||||
definitionShort: e.data.definitionShort,
|
||||
href: `/glossaire/${e.slug}/`,
|
||||
}));
|
||||
|
||||
return new Response(JSON.stringify(index), {
|
||||
headers: {
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
"Cache-Control": "public, max-age=3600",
|
||||
},
|
||||
});
|
||||
};
|
||||
28
src/pages/archicratie/[...slug].astro
Normal file
28
src/pages/archicratie/[...slug].astro
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("archicratie");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Archicratie"
|
||||
editionKey="archicratie"
|
||||
statusLabel="modèle sociopolitique"
|
||||
statusKey="modele_sociopolitique"
|
||||
level={entry.data.level}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<h1>{entry.data.title}</h1>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
15
src/pages/archicratie/index.astro
Normal file
15
src/pages/archicratie/index.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const entries = await getCollection("archicratie");
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
---
|
||||
<SiteLayout title="Essai-thèse — Archicratie">
|
||||
<h1>Essai-thèse — Archicratie</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/archicratie/${e.slug}/`}>{e.data.title}</a></li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
28
src/pages/atlas/[...slug].astro
Normal file
28
src/pages/atlas/[...slug].astro
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("atlas");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Atlas"
|
||||
editionKey="atlas"
|
||||
statusLabel="cartographie"
|
||||
statusKey="cartographie"
|
||||
level={entry.data.level}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<h1>{entry.data.title}</h1>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
15
src/pages/atlas/index.astro
Normal file
15
src/pages/atlas/index.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const entries = await getCollection("atlas");
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
---
|
||||
<SiteLayout title="Atlas archicratique">
|
||||
<h1>Atlas archicratique</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/atlas/${e.slug}/`}>{e.data.title}</a></li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
7
src/pages/editions/index.astro
Normal file
7
src/pages/editions/index.astro
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
---
|
||||
<SiteLayout title="Carte des œuvres">
|
||||
<h1>Carte des œuvres</h1>
|
||||
<p>Cette page explicite la séparation stricte et l’articulation entre les éditions.</p>
|
||||
</SiteLayout>
|
||||
29
src/pages/glossaire/[...slug].astro
Normal file
29
src/pages/glossaire/[...slug].astro
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("glossaire");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Glossaire"
|
||||
editionKey="glossaire"
|
||||
statusLabel="référentiel"
|
||||
statusKey="referentiel"
|
||||
level={1}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<h1>{entry.data.term}</h1>
|
||||
<p><em>{entry.data.definitionShort}</em></p>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
15
src/pages/glossaire/index.astro
Normal file
15
src/pages/glossaire/index.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
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>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
28
src/pages/ia/[...slug].astro
Normal file
28
src/pages/ia/[...slug].astro
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("ia");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Cas IA"
|
||||
editionKey="ia"
|
||||
statusLabel="application"
|
||||
statusKey="application"
|
||||
level={entry.data.level}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<h1>{entry.data.title}</h1>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
15
src/pages/ia/index.astro
Normal file
15
src/pages/ia/index.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const entries = await getCollection("ia");
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
---
|
||||
<SiteLayout title="Cas pratique — Gouvernance des systèmes IA">
|
||||
<h1>Cas pratique — Gouvernance des systèmes IA</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/ia/${e.slug}/`}>{e.data.title}</a></li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
@@ -1,16 +1,19 @@
|
||||
---
|
||||
|
||||
import SiteLayout from "../layouts/SiteLayout.astro";
|
||||
---
|
||||
<SiteLayout title="Accueil">
|
||||
<h1>Archicratie — Édition web</h1>
|
||||
<p>
|
||||
Portail d’accès aux éditions : Traité (Ontodynamique générative), Essai-thèse (Archicratie),
|
||||
Cas pratique (IA), Glossaire, Atlas.
|
||||
</p>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>Astro</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Astro</h1>
|
||||
</body>
|
||||
</html>
|
||||
<ul>
|
||||
<li><a href="/editions/">Carte des œuvres</a></li>
|
||||
<li><a href="/archicratie/">Essai-thèse — Archicratie</a></li>
|
||||
<li><a href="/traite/">Traité — Ontodynamique générative</a></li>
|
||||
<li><a href="/ia/">Cas pratique — Gouvernance des systèmes IA</a></li>
|
||||
<li><a href="/glossaire/">Glossaire archicratique</a></li>
|
||||
<li><a href="/atlas/">Atlas archicratique</a></li>
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
|
||||
38
src/pages/methode/index.astro
Normal file
38
src/pages/methode/index.astro
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
---
|
||||
<SiteLayout title="Méthode & statut des textes">
|
||||
<h1>Méthode & statut des textes</h1>
|
||||
|
||||
<h2>1) Séparation stricte des productions</h2>
|
||||
<ul>
|
||||
<li><strong>Traité</strong> : ontodynamique générative (théorie fondamentale).</li>
|
||||
<li><strong>Essai-thèse</strong> : archicratie (modèle sociopolitique).</li>
|
||||
<li><strong>Cas pratique</strong> : gouvernance des systèmes IA (application).</li>
|
||||
<li><strong>Glossaire</strong> : référentiel terminologique (définitions et renvois).</li>
|
||||
<li><strong>Atlas</strong> : cartographie des archicrates (à venir).</li>
|
||||
</ul>
|
||||
|
||||
<h2>2) Règle d’or : liens typés</h2>
|
||||
<p>Tout lien important est explicitement typé :</p>
|
||||
<ul>
|
||||
<li><strong>definition</strong> : renvoi vers le glossaire (sens canonique).</li>
|
||||
<li><strong>appui</strong> : renvoi argumentatif (support).</li>
|
||||
<li><strong>transposition</strong> : analogie / déplacement non-déductif (anti-confusion Traité ↔ Archicratie).</li>
|
||||
</ul>
|
||||
|
||||
<h2>3) Niveaux de lecture</h2>
|
||||
<p>Le même texte peut contenir trois niveaux :</p>
|
||||
<ul>
|
||||
<li><strong>Niveau 1</strong> : lecture citoyenne (accès principal).</li>
|
||||
<li><strong>Niveau 2</strong> : approfondissement.</li>
|
||||
<li><strong>Niveau 3</strong> : niveau recherche.</li>
|
||||
</ul>
|
||||
<p>Techniquement : les blocs <code>.level-2</code> et <code>.level-3</code> sont masqués/affichés par le toggle, sans casser la lisibilité si JS est absent.</p>
|
||||
|
||||
<h2>4) Citabilité</h2>
|
||||
<p>Chaque paragraphe reçoit un identifiant stable et peut être cité par ancre (bouton “Citer”).</p>
|
||||
|
||||
<h2>5) Statut éditorial</h2>
|
||||
<p>Chaque page indique : Édition / Statut / Niveau / Version. Les versions servent à garantir la citabilité et l’historique.</p>
|
||||
</SiteLayout>
|
||||
144
src/pages/recherche/index.astro
Normal file
144
src/pages/recherche/index.astro
Normal file
@@ -0,0 +1,144 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
---
|
||||
<SiteLayout title="Recherche">
|
||||
<h1>Recherche</h1>
|
||||
<p>Recherche plein texte (statique) dans les pages “édition-livre”.</p>
|
||||
|
||||
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0 18px;">
|
||||
<label>
|
||||
<span style="display:block;font-size:12px;opacity:0.85;">Terme</span>
|
||||
<input id="q" type="search" placeholder="Ex: archicratie, régulation, inertie…" style="padding:8px 10px;min-width:280px;">
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span style="display:block;font-size:12px;opacity:0.85;">Édition</span>
|
||||
<select id="edition" style="padding:8px 10px;">
|
||||
<option value="">Toutes</option>
|
||||
<option value="archicratie">Archicratie</option>
|
||||
<option value="traite">Traité</option>
|
||||
<option value="ia">Cas IA</option>
|
||||
<option value="glossaire">Glossaire</option>
|
||||
<option value="atlas">Atlas</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<span style="display:block;font-size:12px;opacity:0.85;">Niveau</span>
|
||||
<select id="level" style="padding:8px 10px;">
|
||||
<option value="">Tous</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="status" style="margin:10px 0;opacity:0.9;"></div>
|
||||
<ol id="results" style="padding-left:18px;"></ol>
|
||||
|
||||
<script is:inline>
|
||||
(() => {
|
||||
const q = document.getElementById("q");
|
||||
const ed = document.getElementById("edition");
|
||||
const lv = document.getElementById("level");
|
||||
const status = document.getElementById("status");
|
||||
const results = document.getElementById("results");
|
||||
|
||||
let pfPromise = null;
|
||||
|
||||
async function getPagefind() {
|
||||
if (pfPromise) return pfPromise;
|
||||
pfPromise = (async () => {
|
||||
try {
|
||||
const pagefind = await import("/pagefind/pagefind.js");
|
||||
// init facultatif, mais accélère si on clique dans l’input
|
||||
await pagefind.init?.();
|
||||
return pagefind;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
return pfPromise;
|
||||
}
|
||||
|
||||
function currentFilters() {
|
||||
const filters = {};
|
||||
if (ed.value) filters.edition = ed.value;
|
||||
if (lv.value) filters.level = lv.value;
|
||||
return Object.keys(filters).length ? filters : null;
|
||||
}
|
||||
|
||||
function clearResults() {
|
||||
results.innerHTML = "";
|
||||
}
|
||||
|
||||
function setStatus(msg) {
|
||||
status.textContent = msg;
|
||||
}
|
||||
|
||||
async function runSearch() {
|
||||
const term = q.value.trim();
|
||||
if (!term) {
|
||||
setStatus("Tape un terme pour chercher.");
|
||||
clearResults();
|
||||
return;
|
||||
}
|
||||
|
||||
const pagefind = await getPagefind();
|
||||
if (!pagefind) {
|
||||
setStatus("Index de recherche indisponible. Fais `npm run build` puis `npm run preview`.");
|
||||
clearResults();
|
||||
return;
|
||||
}
|
||||
|
||||
const opts = {};
|
||||
const filters = currentFilters();
|
||||
if (filters) opts.filters = filters;
|
||||
|
||||
setStatus("Recherche…");
|
||||
const search = await pagefind.debouncedSearch(term, opts, 250);
|
||||
if (search === null) return;
|
||||
|
||||
const items = await Promise.all(search.results.slice(0, 20).map(r => r.data()));
|
||||
setStatus(`${items.length} résultat(s) (sur ${search.results.length}).`);
|
||||
|
||||
results.innerHTML = "";
|
||||
for (const item of items) {
|
||||
const li = document.createElement("li");
|
||||
li.style.marginBottom = "12px";
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.href = item.url;
|
||||
a.textContent = item.meta?.title || item.url;
|
||||
|
||||
const meta = document.createElement("div");
|
||||
meta.style.fontSize = "12px";
|
||||
meta.style.opacity = "0.85";
|
||||
const edv = item.meta?.edition ? `édition: ${item.meta.edition}` : "";
|
||||
const lv = item.meta?.level ? `niveau: ${item.meta.level}` : "";
|
||||
const v = item.meta?.version ? `v${item.meta.version}` : "";
|
||||
meta.textContent = [edv, lv, v].filter(Boolean).join(" · ");
|
||||
|
||||
const ex = document.createElement("div");
|
||||
ex.style.marginTop = "6px";
|
||||
ex.innerHTML = item.excerpt || "";
|
||||
|
||||
li.appendChild(a);
|
||||
if (meta.textContent) li.appendChild(meta);
|
||||
li.appendChild(ex);
|
||||
results.appendChild(li);
|
||||
}
|
||||
}
|
||||
|
||||
// Précharge quand focus => UX meilleure
|
||||
q.addEventListener("focus", () => { getPagefind(); });
|
||||
|
||||
q.addEventListener("input", runSearch);
|
||||
ed.addEventListener("change", runSearch);
|
||||
lv.addEventListener("change", runSearch);
|
||||
|
||||
setStatus("Tape un terme pour chercher.");
|
||||
})();
|
||||
</script>
|
||||
</SiteLayout>
|
||||
22
src/pages/robots.txt.ts
Normal file
22
src/pages/robots.txt.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { APIRoute } from "astro";
|
||||
|
||||
export const prerender = true;
|
||||
|
||||
const robots = (sitemapURL: URL) => `User-agent: *
|
||||
Allow: /
|
||||
|
||||
Disallow: /api/
|
||||
Disallow: /pagefind/
|
||||
|
||||
Sitemap: ${sitemapURL.href}
|
||||
`;
|
||||
|
||||
export const GET: APIRoute = ({ site }) => {
|
||||
// site vient de astro.config (option "site")
|
||||
const base = site ?? new URL("http://localhost:4321/");
|
||||
const sitemapURL = new URL("sitemap-index.xml", base);
|
||||
|
||||
return new Response(robots(sitemapURL), {
|
||||
headers: { "Content-Type": "text/plain; charset=utf-8" },
|
||||
});
|
||||
};
|
||||
28
src/pages/traite/[...slug].astro
Normal file
28
src/pages/traite/[...slug].astro
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
import EditionLayout from "../../layouts/EditionLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const entries = await getCollection("traite");
|
||||
return entries.map((entry) => ({
|
||||
params: { slug: entry.slug },
|
||||
props: { entry },
|
||||
}));
|
||||
}
|
||||
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await entry.render();
|
||||
---
|
||||
|
||||
<EditionLayout
|
||||
title={entry.data.title}
|
||||
editionLabel="Traité"
|
||||
editionKey="traite"
|
||||
statusLabel="théorie fondamentale"
|
||||
statusKey="theorie_fondamentale"
|
||||
level={entry.data.level}
|
||||
version={entry.data.version}
|
||||
>
|
||||
<h1>{entry.data.title}</h1>
|
||||
<Content />
|
||||
</EditionLayout>
|
||||
15
src/pages/traite/index.astro
Normal file
15
src/pages/traite/index.astro
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
import SiteLayout from "../../layouts/SiteLayout.astro";
|
||||
import { getCollection } from "astro:content";
|
||||
|
||||
const entries = await getCollection("traite");
|
||||
entries.sort((a, b) => (a.data.order ?? 9999) - (b.data.order ?? 9999));
|
||||
---
|
||||
<SiteLayout title="Traité — Ontodynamique générative">
|
||||
<h1>Traité — Ontodynamique générative</h1>
|
||||
<ul>
|
||||
{entries.map((e) => (
|
||||
<li><a href={`/traite/${e.slug}/`}>{e.data.title}</a></li>
|
||||
))}
|
||||
</ul>
|
||||
</SiteLayout>
|
||||
Reference in New Issue
Block a user