Fix Breadcrumbs for single pages

This commit is contained in:
Alejandro Rodríguez
2023-09-30 23:40:50 +02:00
committed by GitHub
parent 90dd21b97c
commit 4da7925bf7
+1 -1
View File
@@ -16,7 +16,7 @@ paths.forEach((label: string, i: number) => {
const href = `/${paths.slice(0, i + 1).join("/")}`;
label !== "page" &&
parts.push({
label: humanize(label.replace(/[-_]/g, " ")) || "",
label: humanize(label.replace(".html", "").replace(/[-_]/g, " ")) || "",
href,
"aria-label": Astro.url.pathname === href ? "page" : undefined,
});