Skip to content

Commit

Permalink
layouts: Add markdown render hook to open links in new tab
Browse files Browse the repository at this point in the history
  • Loading branch information
SanchithHegde committed Aug 15, 2020
1 parent 4128b84 commit 2a41549
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}" {{ end }}
{{ if strings.HasPrefix .Destination "mailto" }} target="_blank" {{ end }}
{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noreferrer noopener" {{ end }}
>{{ .Text | safeHTML }}</a>

0 comments on commit 2a41549

Please sign in to comment.