---
import { getCollection } from "astro:content";
const {
currentSlug,
collection = "archicrat-ia",
basePath = "/archicrat-ia",
label = "Table des matières"
} = Astro.props;
const slugOf = (entry) => String(entry.id).replace(/\.(md|mdx)$/i, "");
const hrefOf = (entry) => `${basePath}/${slugOf(entry)}/`;
const collator = new Intl.Collator("fr", { sensitivity: "base", numeric: true });
const entries = [...await getCollection(collection)].sort((a, b) => {
const ao = Number(a.data.order ?? 9999);
const bo = Number(b.data.order ?? 9999);
if (ao !== bo) return ao - bo;
const at = String(a.data.title ?? a.data.term ?? slugOf(a));
const bt = String(b.data.title ?? b.data.term ?? slugOf(b));
return collator.compare(at, bt);
});
---