Files
caperren-com/src/components/InlineLink.astro
Corwin Perren 649b596c7c
All checks were successful
Build and Test - Staging / test (pull_request) Successful in 5m6s
Build and Test - Staging / build_and_push (pull_request) Successful in 5m14s
Build and Test - Staging / deploy_staging (pull_request) Successful in 3s
Added this website as content to hobbies, refactored some items into site-layout
2025-12-10 16:59:54 -08:00

26 lines
556 B
Plaintext

---
import type { ComponentPropsBase } from "@interfaces/components.ts";
interface Props extends ComponentPropsBase {
href: string;
target?: string;
}
const { class: className, href, target } = Astro.props;
const { pathname } = Astro.url;
const finalTarget =
target === undefined ? (href.startsWith("/") ? undefined : "_blank") : target;
---
<>
<a
class:list={["text-blue-500", "hover:text-blue-300", className]}
href={href}
target={finalTarget}
aria-current={pathname === href ? "page" : undefined}
>
<slot />
</a>
</>