feat(header): keep internal social-nav links in same tab
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:
@@ -137,10 +137,11 @@
|
|||||||
{/each}
|
{/each}
|
||||||
<div class="w-1 h-4"></div>
|
<div class="w-1 h-4"></div>
|
||||||
{#each socialLinks as social}
|
{#each socialLinks as social}
|
||||||
|
{@const isInternal = social.href.startsWith("/")}
|
||||||
<a
|
<a
|
||||||
href={social.href}
|
href={social.href}
|
||||||
target="_blank"
|
target={isInternal ? undefined : "_blank"}
|
||||||
rel="noopener noreferrer"
|
rel={isInternal ? undefined : "noopener noreferrer"}
|
||||||
class="p-1.5 -m-1.5 rounded-xs transition-colors flex items-center justify-center"
|
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)}
|
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"
|
class="flex flex-wrap gap-2 pt-2 mt-2 border-t border-stein-0/10"
|
||||||
>
|
>
|
||||||
{#each socialLinks as social}
|
{#each socialLinks as social}
|
||||||
|
{@const isInternal = social.href.startsWith("/")}
|
||||||
<a
|
<a
|
||||||
href={social.href}
|
href={social.href}
|
||||||
target="_blank"
|
target={isInternal ? undefined : "_blank"}
|
||||||
rel="noopener noreferrer"
|
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"
|
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 ||
|
aria-label={social.label ||
|
||||||
t(T.header_social_aria)}
|
t(T.header_social_aria)}
|
||||||
|
|||||||
Reference in New Issue
Block a user