From cf6d9533a607d4e3657e1f90ed80b9c664dc0bb5 Mon Sep 17 00:00:00 2001 From: Demetrius Semanko Date: Thu, 30 Apr 2026 17:22:29 +0000 Subject: [PATCH] Thank you bwc9876 for fixing my navbar styling :-) --- src/components/NavItem.astro | 13 ++++++++++--- 1 file(s) changed, 10 insertion(s)(+), 3 deletion(s)(-) diff --git a/src/components/NavItem.astro b/src/components/NavItem.astro --- a/src/components/NavItem.astro +++ b/src/components/NavItem.astro @@ -1,6 +1,13 @@ --- const { href, label } = Astro.props; -const callerUrl = new URL(Astro.url.pathname, import.meta.env.SITE).href; -const tabUrl = new URL(href, import.meta.env.SITE).href; +/* +Thank you, bwc9876, for helping me figure the `isActive` stuff out! :-) +*/ +const isActive = href === "/" + ? Astro.url.pathname === "/" + : Astro.url.pathname.startsWith(href); --- -{label} +{label} -- tangled.sh