Fix trailing slash in external links

This commit is contained in:
Joshua Goins 2023-04-17 14:17:30 -04:00
parent a11e8e1bc2
commit 79909f7464

View file

@ -1,4 +1,4 @@
{{ $icon := resources.Get "external-link.svg" }}
<a class="ext-link" href="{{ .Destination | safeURL }}" {{ if strings.HasPrefix .Destination "http" }}
target="_blank"{{ end }}>{{ .Text | safeHTML }}{{ if strings.HasPrefix .Destination "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}"/>{{- end -}}</a>
target="_blank"{{ end }}>{{ .Text | safeHTML }}{{ if strings.HasPrefix .Destination "http" }}<img class="external-link" aria-hidden="true" alt="External link" width="16" height="16" src="{{ $icon.Permalink }}">{{- end -}}</a>