another commit without a list of specific changes! (misc)

This commit is contained in:
2025-08-21 15:07:10 -04:00
parent 1528931a29
commit 315919186b
15 changed files with 299 additions and 112 deletions

View File

@@ -40,12 +40,15 @@ const currentPath = Astro.url.pathname;
const isExternal = item.href?.startsWith("http");
const isAuthedPath = item.auth ?? false;
const normalize = (url) => url?.replace(/\/+$/, '') || '/';
const normalizedCurrent = normalize(currentPath).replace(/\/$/, ""); // remove trailing slash
const normalizedHref = normalize(item.href).replace(/\/$/, "");
const normalize = (url) => (url || '/').replace(/\/+$/, '') || '/';
const normalizedCurrent = normalize(currentPath);
const normalizedHref = normalize(item.href);
const isActive = !isExternal && (
normalizedCurrent === normalizedHref ||
normalizedCurrent.startsWith(normalizedHref + "/"));
normalizedHref === '/'
? normalizedCurrent === '/' // Home only matches exact /
: normalizedCurrent === normalizedHref || normalizedCurrent.startsWith(normalizedHref + '/')
);
const nextItem = navItems[index + 1];
const shouldShowThinBar = nextItem //&& !nextItem.blockSeparator;