fix(render-link): add rel='noopener' for external links

This commit is contained in:
David Guillot 2024-10-09 17:38:03 +02:00
parent 077d477f7f
commit 439996f230

View File

@ -1,4 +1,5 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}
{{ if strings.HasPrefix .Destination "http" }} rel="noopener"{{ end }}
{{ if and site.Params.ExternalLinksIcon (strings.HasPrefix .Destination "http") }} class="external-link"{{ end }}
{{ if and site.Params.ExternalLinksNewTab (strings.HasPrefix .Destination "http") }} target="_blank"{{ end }}
>{{ .Text }}</a>