Making external links open in a new tab by using the replaceRE function to change the output of .Content

Try link render hook.

Save the following code as layouts/_default/_markup/render-link.html.

{{- $u := urls.Parse .Destination -}}
<a href="{{ .Destination | safeURL }}"
  {{- with .Title }} title="{{ . }}"{{ end -}}
  {{- if $u.IsAbs }} rel="external" target="_blank"{{ end -}}
>
  {{- with .Text }}{{ . }}{{ end -}}
</a>
{{- /* chomp trailing newline */ -}}