{{/* S'il n'y a pas de / dans l'url d'un lien alors on ajoute le path du répertoire */}} {{ $isExternalLink := strings.HasPrefix .Destination "http" }} {{ $isWebLink := or $isExternalLink (eq 0 (.Destination | strings.Count ":")) }} {{ $isTelLink := strings.HasPrefix .Destination "tel:" }} {{ $isMailtoLink := strings.HasPrefix .Destination "mailto:" }} {{- if $isWebLink -}} {{ $hasSlash := in .Destination "/" }} {{ $link := cond (and $isWebLink (and (not $hasSlash) (not $isExternalLink))) (path.Join "/" .Page.File.Dir .Destination) .Destination }} {{ .Text | safeHTML }} {{- else if $isMailtoLink -}} {{ partial "contact/mail" .Destination }} {{- else if $isTelLink -}} {{ partial "contact/telephone" .Destination }} {{- end -}}