{{- $u := urls.Parse .Destination -}} {{- $href := $u.String -}} {{- if not $u.IsAbs -}} {{- with or ($.Page.GetPage $u.Path) ($.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $href = .RelPermalink -}} {{- with $u.RawQuery -}} {{- $href = printf "%s?%s" $href . -}} {{- end -}} {{- with $u.Fragment -}} {{- $href = printf "%s#%s" $href . -}} {{- end -}} {{- end -}} {{- end -}} {{- $attributes := dict "href" $href "title" .Title -}} {{ .Text | safeHTML }} {{- /**/ -}}