Skip to content

Commit c764559

Browse files
committed
feat: bold header links when on that page
1 parent 11a5ccd commit c764559

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/components/Header.astro

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,22 @@ import DownloadButton from "./ui/DownloadButton.astro";
1515
<ul
1616
class="text-prism-text-light dark:text-prism-text-dark flex items-center gap-4 font-medium"
1717
>
18-
<li><a class="hover:underline" href="/news">News</a></li>
19-
<li><a class="hover:underline" href="/about">About</a></li>
18+
<li>
19+
<a
20+
class={`hover:underline ${Astro.url.pathname.startsWith("/news") ? "font-bold" : ""}`}
21+
href="/news"
22+
>
23+
News
24+
</a>
25+
</li>
26+
<li>
27+
<a
28+
class={`hover:underline ${Astro.url.pathname.startsWith("/about") ? "font-bold" : ""}`}
29+
href="/about"
30+
>
31+
About
32+
</a>
33+
</li>
2034
<li><a class="hover:underline" href="/wiki">Wiki</a></li>
2135
<li><a class="hover:underline" href="/#get-involved">Community</a></li>
2236
</ul>

0 commit comments

Comments
 (0)