From 7d4c8e6cb16c4080a67b04c4cdb7ce5c0f85f83d Mon Sep 17 00:00:00 2001 From: Kai Moschcau Date: Thu, 2 Apr 2026 18:22:44 +0200 Subject: [PATCH] feat: add a link to blecon.de --- src/components/button-link.astro | 5 +++-- src/components/inline-link.astro | 5 +++-- src/link-utils.ts | 7 +++++++ src/pages/index.astro | 26 +++++++++++++++++--------- src/pages/skills.astro | 8 ++++++-- src/styles/global.css | 4 ++++ 6 files changed, 40 insertions(+), 15 deletions(-) create mode 100644 src/link-utils.ts diff --git a/src/components/button-link.astro b/src/components/button-link.astro index 69221a0..402db55 100644 --- a/src/components/button-link.astro +++ b/src/components/button-link.astro @@ -1,9 +1,10 @@ --- import type { HTMLAttributes } from "astro/types"; +import { getRel } from "../link-utils"; interface Props extends HTMLAttributes<"a"> { /** Whether this link should use defaults for external links. */ - external?: boolean | null | undefined; + external?: boolean | "me" | null | undefined; } const { class: className, external, target, rel, ...rest } = Astro.props; @@ -15,6 +16,6 @@ const { class: className, external, target, rel, ...rest } = Astro.props; "flex min-w-full items-center justify-center gap-4 rounded px-6 py-2 text-lg outline-offset-2 sm:px-24", ]} target={target ?? (external ? "_blank" : undefined)} - rel={rel ?? (external ? "external me nofollow noreferrer" : undefined)} + rel={rel ?? getRel(external)} {...rest}> diff --git a/src/components/inline-link.astro b/src/components/inline-link.astro index 9bdc028..6f6d3f9 100644 --- a/src/components/inline-link.astro +++ b/src/components/inline-link.astro @@ -2,10 +2,11 @@ import type { HTMLAttributes } from "astro/types"; import ExternalIcon from "../icons/arrow-top-right-on-square.svg"; import InlineSvg from "./inline-svg.astro"; +import { getRel } from "../link-utils"; interface Props extends HTMLAttributes<"a"> { /** Whether this link should use defaults for external links. */ - external?: boolean | null | undefined; + external?: boolean | "me" | null | undefined; } const { external, target, rel, ...rest } = Astro.props; @@ -13,7 +14,7 @@ const { external, target, rel, ...rest } = Astro.props; { external ? ( diff --git a/src/link-utils.ts b/src/link-utils.ts new file mode 100644 index 0000000..453dc00 --- /dev/null +++ b/src/link-utils.ts @@ -0,0 +1,7 @@ +export function getRel( + external: boolean | "me" | null | undefined, +): string | undefined { + return external + ? "external nofollow noreferrer".concat(external === "me" ? " me" : "") + : undefined; +} diff --git a/src/pages/index.astro b/src/pages/index.astro index 50aaeae..3981b07 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,7 @@ --- import { Image } from "astro:assets"; import ButtonLink from "../components/button-link.astro"; +import InlineLink from "../components/inline-link.astro"; import GitHubLogo from "../images/GitHub.svg"; import GitLabLogo from "../images/GitLab.svg"; import KeyoxideLogo from "../images/Keyoxide.svg"; @@ -25,10 +26,17 @@ import BaseLayout from "../layouts/BaseLayout.astro";

Fachinformatiker für Anwendungsentwicklung

-