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 8, 2024
1 parent 83208d3 commit bd755b6
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 bd755b6

Please sign in to comment.