diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index dfe99040f..2938f79e6 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -10,6 +10,18 @@ const breadcrumbList = currentUrlPath.split("/").slice(1); // replace Posts with Posts (page number) breadcrumbList[0] === "posts" && breadcrumbList.splice(0, 2, `Posts (page ${breadcrumbList[1] || 1})`); + +// if breadcrumb is Home > Tags > [tag] > [page] +// replace [tag] > [page] with [tag] (page number) +breadcrumbList[0] === "tags" && + !isNaN(Number(breadcrumbList[2])) && + breadcrumbList.splice( + 1, + 3, + `${breadcrumbList[1]} ${ + Number(breadcrumbList[2]) === 1 ? "" : "(page " + breadcrumbList[2] + ")" + }` + ); ---