Skip to content

Commit e438679

Browse files
committed
Handle when rel has two values
1 parent a057f77 commit e438679

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

layouts/_partials/footer/links.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<ul class="td-footer__links-list">
22
{{ range . }}
3+
{{ $rel := .rel | string -}}
34
{{ $isExternal := hasPrefix .url "http" -}}
5+
{{ if $isExternal -}}
6+
{{ $rel = cond $rel (add $rel " noopener") "noopener" -}}
7+
{{ end -}}
48
<li class="td-footer__links-item" data-bs-toggle="tooltip" title="{{ .name }}" aria-label="{{ .name }}">
59
<a href="{{ .url }}" aria-label="{{ .name }}"
6-
{{- with .rel }} rel="{{ . }}" {{- end -}}
7-
{{ if $isExternal }} target="_blank" rel="noopener" {{- end -}}
10+
{{- if $isExternal }} target="_blank" {{- end -}}
11+
{{ with $rel }} rel="{{ . }}" {{- end -}}
812
>
913
<i class="{{ .icon }}"></i>
1014
</a>

0 commit comments

Comments
 (0)