Removed unused build, refactored H1-3 to use slot based setup, added visual and aria page highlighting for navbar links, switched all pages to use custom H1-3, better new page/tab handling for inline links
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
---
|
||||
interface Props {
|
||||
import type { ComponentPropsBase } from "@interfaces/components.ts";
|
||||
|
||||
interface Props extends ComponentPropsBase {
|
||||
href: string;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
const { href, target = "_blank" } = Astro.props;
|
||||
const { class: className, href, target } = Astro.props;
|
||||
|
||||
let finalTarget: string | undefined = target;
|
||||
|
||||
if (target === undefined) {
|
||||
if (href.startsWith("/")) {
|
||||
finalTarget = "";
|
||||
} else {
|
||||
finalTarget = "_blank";
|
||||
}
|
||||
}
|
||||
---
|
||||
|
||||
<>
|
||||
<a class="text-blue-500 hover:text-blue-300" href={href} target={target}>
|
||||
<a
|
||||
class:list={["text-blue-500", "hover:text-blue-300", className]}
|
||||
href={href}
|
||||
target={finalTarget}
|
||||
>
|
||||
<slot />
|
||||
</a>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user