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 -}}