Skip to content

Commit 561d1fb

Browse files
committed
fixing the lower bar first attempt
1 parent 2a8702a commit 561d1fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/Nav.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ const currentPage = Astro.url.pathname;
1111
<nav>
1212
<ul class="nav-list">
1313
{links.map(({ href, name, icon }) => {
14-
const isActive = currentPage === href;
14+
const isActive =
15+
href === "/"
16+
? currentPage === "/" // Exact match for home
17+
: currentPage.startsWith(href); // Partial match for other links
18+
1519
return (
1620
<li>
1721
<a

0 commit comments

Comments
 (0)