Open External Links in a New Tab in Hugo
Create a file namedrender-link.html
in your theme layouts folder. The order goes like thislayouts/_default/_markup/render-link.html
layouts
└── _default
└── _markup
└── render-link.html
Then for the contents of the filerender-link.html
itself is more or less like this:
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} rel="noopener noreferrer" target="_blank"{{ end }}>{{ .Text }}</a>