通过 Markdown Render Hooks | Hugo 实现此功能

./layouts/_default/_markup/render-link.html
1
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener nofollow noreferrer" {{ end }}>{{ .Text  | safeHTML }}</a>