feat(header): keep internal social-nav links in same tab
Deploy / verify (push) Successful in 55s
Deploy / deploy (push) Successful in 57s

Social-link entries with internal URLs (starting with /) used to open in a
new tab via target=_blank, which is wrong for internal navigation like the
new /kalender entry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-05-08 07:53:43 +02:00
parent 892afc2d9f
commit ce4c4570d6
+8 -4
View File
@@ -137,10 +137,11 @@
{/each}
<div class="w-1 h-4"></div>
{#each socialLinks as social}
{@const isInternal = social.href.startsWith("/")}
<a
href={social.href}
target="_blank"
rel="noopener noreferrer"
target={isInternal ? undefined : "_blank"}
rel={isInternal ? undefined : "noopener noreferrer"}
class="p-1.5 -m-1.5 rounded-xs transition-colors flex items-center justify-center"
aria-label={social.label || t(T.header_social_aria)}
>
@@ -260,10 +261,13 @@
class="flex flex-wrap gap-2 pt-2 mt-2 border-t border-stein-0/10"
>
{#each socialLinks as social}
{@const isInternal = social.href.startsWith("/")}
<a
href={social.href}
target="_blank"
rel="noopener noreferrer"
target={isInternal ? undefined : "_blank"}
rel={isInternal
? undefined
: "noopener noreferrer"}
class="inline-flex p-2 text-stein-100 hover:text-stein-0 hover:bg-stein-0/10 rounded-xs transition-colors"
aria-label={social.label ||
t(T.header_social_aria)}