code added to open external links in a new tab

This commit is contained in:
Courtney Frey 2022-12-16 10:10:21 -06:00 committed by Sören Weber
parent 62960a4113
commit 95e07665a7

View file

@ -0,0 +1,5 @@
<!-- This code opens an external link in a new tab. -->
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>
{{ .Text | safeHTML }}
</a>