layouts: Add markdown render hook to open links in new tab

This commit is contained in:
Sanchith Hegde 2020-08-15 18:34:40 +05:30
parent 559ccfe896
commit 675564be42
1 changed files with 4 additions and 0 deletions

View File

@ -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>