File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ import Container from ' @/components/Container.astro' ;
3+
4+ const pathname = Astro .url .pathname ;
5+
6+ const isHomePage = pathname === ' /' ;
7+ const isWritingPage = pathname .startsWith (' /writing' );
8+
9+ ---
10+
11+ <header >
12+ <Container >
13+ <div class =" flex justify-end" >
14+ <nav class =" flex items-center gap-4" >
15+ <ul class =" flex items-center gap-6" >
16+ <li >
17+ <a href =" /" class:list ={ [
18+ ' font-medium transition-colors' ,
19+ ' hover:text-headings' ,
20+ isHomePage && ' text-headings' ,
21+ ]} >Home</a >
22+ </li >
23+ <li >
24+ <a href =" /writing" class:list ={ [
25+ ' font-medium transition-colors' ,
26+ ' hover:text-headings' ,
27+ isWritingPage && ' text-headings' ,
28+ ]} >Writing</a >
29+ </li >
30+ </ul >
31+ </nav >
32+ </div >
33+ </Container >
34+ </header >
You can’t perform that action at this time.
0 commit comments