Merge pull request 'EditionToc Modif' (#215) from chore/astro6-upgrade into main
All checks were successful
SMOKE / smoke (push) Successful in 9s
CI / build-and-anchors (push) Successful in 42s
Deploy staging+live (annotations) / deploy (push) Successful in 7m16s

Reviewed-on: #215
This commit was merged in pull request #215.
This commit is contained in:
2026-03-11 17:58:17 +01:00

View File

@@ -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)}/`;
---
<nav class="toc-global" aria-label={label}>
@@ -21,10 +22,12 @@ const href = (slug) => `${basePath}/${slug}/`;
<ol class="toc-global__list">
{entries.map((e) => {
const active = e.slug === currentSlug;
const entrySlug = routeSlug(e);
const active = entrySlug === currentSlug;
return (
<li class={`toc-item ${active ? "is-active" : ""}`}>
<a class="toc-link" href={href(e.slug)} aria-current={active ? "page" : undefined}>
<a class="toc-link" href={href(e)} aria-current={active ? "page" : undefined}>
<span class="toc-link__row">
{active ? (
<span class="toc-active-indicator" aria-hidden="true">👉</span>