From 1ffbf71a057e8789fd6471e319a9a16c4ce031e1 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Fri, 27 Dec 2024 13:01:37 +0100 Subject: update urls --- src/components/HeaderLink.astro | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/components/HeaderLink.astro') diff --git a/src/components/HeaderLink.astro b/src/components/HeaderLink.astro index 41da846..b98a39e 100644 --- a/src/components/HeaderLink.astro +++ b/src/components/HeaderLink.astro @@ -1,24 +1,28 @@ --- -import type { HTMLAttributes } from 'astro/types'; +import type { HTMLAttributes } from "astro/types"; -type Props = HTMLAttributes<'a'>; +type Props = HTMLAttributes<"a">; const { href, class: className, ...props } = Astro.props; -const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, ''); +const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, ""); const subpath = pathname.match(/[^\/]+/g); -const isActive = href === pathname || href === '/' + (subpath?.[0] || ''); +const isActive = href === pathname || href === "/" + (subpath?.[0] || ""); --- - - + + -- cgit v1.2.3