Skip to content

Commit c9a98f4

Browse files
committed
feat: added partial header component
1 parent 30e7cae commit c9a98f4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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>

0 commit comments

Comments
 (0)