diff --git a/src/components/Nav.astro b/src/components/Nav.astro index c3cf0ae..b628364 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -39,7 +39,9 @@ const currentPath = Astro.url.pathname; } const isExternal = item.href?.startsWith("http"); - const isActive = !isExternal && item.href === currentPath; + const normalize = (url) => url?.replace(/\/+$/, '') || '/'; + const isActive = !isExternal && normalize(item.href) === normalize(currentPath); + const nextItem = navItems[index + 1]; const shouldShowThinBar = nextItem && !nextItem.blockSeparator;