misc
This commit is contained in:
@@ -41,7 +41,11 @@ const currentPath = Astro.url.pathname;
|
||||
const isExternal = item.href?.startsWith("http");
|
||||
const isAuthedPath = item.auth ?? false;
|
||||
const normalize = (url) => url?.replace(/\/+$/, '') || '/';
|
||||
const isActive = !isExternal && normalize(item.href) === normalize(currentPath);
|
||||
const normalizedCurrent = normalize(currentPath).replace(/\/$/, ""); // remove trailing slash
|
||||
const normalizedHref = normalize(item.href).replace(/\/$/, "");
|
||||
const isActive = !isExternal && (
|
||||
normalizedCurrent === normalizedHref ||
|
||||
normalizedCurrent.startsWith(normalizedHref + "/"));
|
||||
|
||||
const nextItem = navItems[index + 1];
|
||||
const shouldShowThinBar = nextItem //&& !nextItem.blockSeparator;
|
||||
|
Reference in New Issue
Block a user