From 338bcf12e0b7bbd6e587ec992e62860642856e80 Mon Sep 17 00:00:00 2001 From: "houston[bot]" Date: Sat, 22 Jul 2023 12:57:20 -0700 Subject: Initial commit from Astro --- src/components/HeaderLink.astro | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/components/HeaderLink.astro (limited to 'src/components/HeaderLink.astro') diff --git a/src/components/HeaderLink.astro b/src/components/HeaderLink.astro new file mode 100644 index 0000000..3dd439b --- /dev/null +++ b/src/components/HeaderLink.astro @@ -0,0 +1,24 @@ +--- +import type { HTMLAttributes } from 'astro/types'; + +type Props = HTMLAttributes<'a'>; + +const { href, class: className, ...props } = Astro.props; + +const { pathname } = Astro.url; +const isActive = href === pathname || href === pathname.replace(/\/$/, ''); +--- + + + + + -- cgit v1.2.3