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)}/`; ---