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;