mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-08 02:33:02 +00:00
super basic pagination
This commit is contained in:
10
src/components/Header.astro
Normal file
10
src/components/Header.astro
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
import NavLink from "./NavLink.astro";
|
||||
|
||||
const { currentPage } = Astro.props;
|
||||
---
|
||||
|
||||
<header class="flex gap-2 p-2 border-b-1">
|
||||
<NavLink currentPage={currentPage} title="home" href="/" />
|
||||
<NavLink currentPage={currentPage} title="about" href="/about" />
|
||||
</header>
|
||||
9
src/components/NavLink.astro
Normal file
9
src/components/NavLink.astro
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
const { currentPage, title, href } = Astro.props;
|
||||
---
|
||||
|
||||
<a
|
||||
href={href}
|
||||
class={`${currentPage === title ? "bg-black text-white" : ""} px-1 rounded-sm`}
|
||||
>{title}</a
|
||||
>
|
||||
Reference in New Issue
Block a user