diff --git a/src/components/PageTitleWithBreadcrumbs.astro b/src/components/PageTitleWithBreadcrumbs.astro index 13ca071..a5a9019 100644 --- a/src/components/PageTitleWithBreadcrumbs.astro +++ b/src/components/PageTitleWithBreadcrumbs.astro @@ -10,11 +10,22 @@ const pathname = Astro.url.pathname; // Only show on /reference pages for now const showBreadcrumbs = !hideBreadcrumbs && pathname.startsWith("/reference/"); + +// Build crumbs manually to preserve correct casing. +// Astro lowercases URL slugs, so we use the frontmatter title for the last segment. +const pageTitle = Astro.locals.starlightRoute?.entry?.data?.title; +const segments = pathname.split("/").filter(Boolean); +const crumbs = segments.map((seg, i) => ({ + text: i === segments.length - 1 && pageTitle + ? pageTitle + : seg.charAt(0).toUpperCase() + seg.slice(1), + href: "/" + segments.slice(0, i + 1).join("/") + "/", +})); --- { showBreadcrumbs && ( - +