{{ $link := .Destination }}
{{ if not (strings.HasPrefix $link "http") }}
    {{ $link = (.Page.GetPage .Destination).RelPermalink }}
{{ end }}
<a href="{{ $link | safeURL }}">{{ .Text | safeHTML }}</a>