From 37cb8362466c3216261f228ddc6e4ca4024e6ff5 Mon Sep 17 00:00:00 2001 From: Archicratia Date: Wed, 11 Mar 2026 17:56:53 +0100 Subject: [PATCH] chore(astro): upgrade to Astro 6 and fix dynamic collection routes --- src/components/EditionToc.astro | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/EditionToc.astro b/src/components/EditionToc.astro index 5279142..f10e9b6 100644 --- a/src/components/EditionToc.astro +++ b/src/components/EditionToc.astro @@ -11,7 +11,8 @@ const { const entries = (await getCollection(collection)) .sort((a, b) => (a.data.order ?? 0) - (b.data.order ?? 0)); -const href = (slug) => `${basePath}/${slug}/`; +const routeSlug = (entry) => String(entry.id || "").replace(/\.(md|mdx)$/i, ""); +const href = (entry) => `${basePath}/${routeSlug(entry)}/`; ---