diff --git a/docs/layouts/_default/_markup/render-link.html b/docs/layouts/_default/_markup/render-link.html index 27913267..92f01703 100644 --- a/docs/layouts/_default/_markup/render-link.html +++ b/docs/layouts/_default/_markup/render-link.html @@ -1,11 +1,16 @@ -{{ $link := .Destination -}} -{{ $isRemote := strings.HasPrefix $link "http" -}} -{{ if not $isRemote -}} -{{ $url := urls.Parse .Destination -}} -{{ if $url.Path -}} -{{ $fragment := "" -}} -{{ with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} -{{ with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end }}{{ end -}} -{{ end -}} +{{- $link := .Destination }} +{{- $isRemote := strings.HasPrefix $link "http" }} +{{- if not $isRemote }} + {{- $url := urls.Parse .Destination }} + {{- if $url.Path }} + {{- $fragment := "" }} + {{- with $url.Fragment }} + {{ $fragment = printf "#%s" . }} + {{- end }} + {{- with .Page.GetPage $url.Path }} + {{- $link = printf "%s%s" .RelPermalink $fragment }} + {{- end }} + {{- end }} +{{- end -}} {{ .Text | safeHTML }} {{- /* This comment removes trailing newlines. */ -}}