Fix links not being urlized

This commit is contained in:
Joshua Goins 2023-08-10 10:47:01 -04:00
parent 6243410178
commit bbf8d88173

View file

@ -1,4 +1,4 @@
{{ $icon := resources.Get "external-link.svg" }} {{ $icon := resources.Get "external-link.svg" }}
<a class="ext-link" href="{{ .Destination | safeURL }}" {{ if strings.HasPrefix .Destination "http" }} <a class="ext-link" href="{{ .Destination | urlize | 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.RelPermalink }}">{{- 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.RelPermalink }}">{{- end -}}</a>