{{- $dest := .Destination -}}
{{- if hasPrefix $dest "#" -}}
  {{- $dest = printf "%s%s" .Page.RelPermalink $dest -}}
{{- end -}}
{{- $target := $dest | safeURL -}}
{{- $destHost := (urls.Parse .Destination).Host -}}
{{- $external := and (ne $destHost "") (ne $destHost (urls.Parse .Page.Site.BaseURL).Host) -}}
<a href="{{ $dest | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if $external }} target="_blank" rel="noopener noreferrer"{{ end }}>
  {{- .Text | safeHTML -}}
  {{- if and $external (defaul