{{$src := .Destination | safeURL }} {{$external := strings.HasPrefix $src "http" }} {{- if $external -}} {{- else -}} {{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}} {{- end -}}