Hugo
1 min
How To Tell Hugo To Open Links In New Tab #
To open links in new tabs using Hugo’s Goldmark renderer, do the following:
- Create this file layouts/_default/_markup/render-link.html
- Add this in the file:
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>
{{ .Text }}
</a>