Skip to content

Commit

Permalink
fix(render-link): add rel='noopener' for external links
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Guillot committed Nov 12, 2024
1 parent 077d477 commit 439996f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 439996f

Please sign in to comment.