diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro new file mode 100644 index 0000000..f3f9fec --- /dev/null +++ b/src/components/Breadcrumbs.astro @@ -0,0 +1,43 @@ +--- +const breadcrumbList = Astro.url.pathname.split("/").slice(1); + +// if breadcrumb is Home > Post > 'article-name' +// replace 'article-name' to 'current post' +if (breadcrumbList[0] === "posts" && breadcrumbList.length > 1) { + breadcrumbList.splice(1, 1, "current post"); +} +--- + + + +