theme(fix): making sure the noopener rel attribute stays even with other configurations

Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
This commit is contained in:
Patrick Kollitsch 2024-10-20 17:23:51 +07:00
parent 7913086a0f
commit 8762f563f9
No known key found for this signature in database
GPG Key ID: 5A5360B005AD68C7

View File

@ -13,7 +13,7 @@
{{- $setup := . -}} {{- $setup := . -}}
{{- $network := $setup.slug -}} {{- $network := $setup.slug -}}
{{- $profile := index $config $network -}} {{- $profile := index $config $network -}}
{{- $rel := $setup.rel | default "noopener" -}} {{- $rel := $setup.rel | default "" -}}
{{- $label := $profile.label | default $setup.label -}} {{- $label := $profile.label | default $setup.label -}}
{{- $link := (printf $setup.profile $profile.username) -}} {{- $link := (printf $setup.profile $profile.username) -}}
@ -22,7 +22,7 @@
{{- end -}} {{- end -}}
{{- $languageDirection := cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}} {{- $languageDirection := cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" -}}
<a href="{{ $link }}" target="_blank" rel="{{ $rel }}" <a href="{{ $link }}" target="_blank" rel="noopener{{- with $rel }} {{ . -}}{{- end -}}"
class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ $languageDirection }}" class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ $languageDirection }}"
title="follow on {{ $label }} - Opens in a new window" title="follow on {{ $label }} - Opens in a new window"
aria-label="follow on {{ $label }} - Opens in a new window"> aria-label="follow on {{ $label }} - Opens in a new window">