From f84ee845111680375744a36f5a92ebe7bfd9addf Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 30 Jun 2026 11:01:27 +0300 Subject: [PATCH] Use session title in breadcrumb instead of converted URL slug --- src/components/Breadcrumbs.astro | 4 +++- src/layouts/Layout.astro | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index c598ef9c7..e62d5df2c 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -4,6 +4,7 @@ import Section from "@ui/Section.astro"; export interface Props { linksData: any; currentPath: string; + currentLabel?: string; homeLabel?: string; homePath?: string; separator?: string; @@ -12,6 +13,7 @@ export interface Props { const { linksData, currentPath, + currentLabel, homeLabel = "Home", homePath = "/", separator = "/" @@ -84,7 +86,7 @@ if (breadcrumbs.length === 1 && normalizedCurrentPath !== normalizePath(homePath if (lastSegment) { breadcrumbs.push({ - name: lastSegment.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()), + name: currentLabel ?? lastSegment.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase()), path: currentPath, isActive: true }); diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 60ed1dd01..a58975637 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -70,6 +70,7 @@ const hideFooter = Astro.props.hideFooter ?? false;