super basic pagination

This commit is contained in:
Oliver Bryan
2025-09-08 12:09:20 +01:00
parent 012af7a95d
commit 1a753e1a76
5 changed files with 51 additions and 14 deletions

View 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>

View 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
>