---
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>
