diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 39e6f69..557cf63 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,10 +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 -}} -{{- if .Page.GetPage $url.Path }}{{ $link = printf "%s%s" (.Page.GetPage $url.Path).RelPermalink $fragment }}{{ end }}{{ end -}} -{{- end -}} -{{- .Text | safeHTML -}}{{ if $isRemote }} {{ 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 -}} + \ No newline at end of file