We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8702a commit 561d1fbCopy full SHA for 561d1fb
src/components/Nav.astro
@@ -11,7 +11,11 @@ const currentPage = Astro.url.pathname;
11
<nav>
12
<ul class="nav-list">
13
{links.map(({ href, name, icon }) => {
14
- const isActive = currentPage === href;
+ const isActive =
15
+ href === "/"
16
+ ? currentPage === "/" // Exact match for home
17
+ : currentPage.startsWith(href); // Partial match for other links
18
+
19
return (
20
<li>
21
<a
0 commit comments