From 4f382e7e17d48159a09eb4c696279c16b41014af Mon Sep 17 00:00:00 2001 From: Simon C Date: Tue, 19 Jan 2021 23:53:27 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20Suppression=20des=20espaces=20apr=C3=A8?= =?UTF-8?q?s=20et=20avant=20les=20liens?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/_default/_markup/render-link.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 30d83f7..507ecd4 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -6,10 +6,10 @@ {{ $isTelLink := strings.HasPrefix .Destination "tel:" }} {{ $isMailtoLink := strings.HasPrefix .Destination "mailto:" }} {{ $hasSlash := in .Destination "/" }} -{{ if $isWebLink }} +{{- if $isWebLink -}} {{ $link := cond (and $isWebLink (and (not $hasSlash) (not $isExternalLink))) (path.Join "/" .Page.Dir .Destination) .Destination }} {{ .Text | safeHTML }} -{{ else }} +{{- else -}} {{- $separators := cond $isMailtoLink ":@." ":" -}} {{- $regex := cond $isMailtoLink "[a-z]*:(.*)" "[a-z]*:([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})"}} {{- $replace := cond $isMailtoLink "$1" "$1 $2 $3 $4 $5" -}} @@ -32,4 +32,4 @@ data-replace="{{ $replace }}" > -{{ end }} +{{- end -}}