From 0a6267c171e799ac8c0297f6e1ca8d2c318a921c Mon Sep 17 00:00:00 2001 From: Tomy Hsieh Date: Thu, 22 Feb 2024 21:36:43 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20fix:=20Space=20in=20rendered=20l?= =?UTF-8?q?ink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/_default/_markup/render-link.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 00f1874a..6e73759d 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,9 +1,9 @@ {{- $link := .Destination -}} {{- $isRemote := strings.HasPrefix $link "http" -}} {{- if not $isRemote }} - {{ $url := urls.Parse .Destination }} + {{- $url := urls.Parse .Destination -}} {{- if $url.Path }} - {{ $fragment := "" }} + {{- $fragment := "" }} {{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} {{- with .Page.GetPage $url.Path }} {{ $link = printf "%s%s" .RelPermalink $fragment }} @@ -14,5 +14,4 @@ {{ end -}} {{ end -}} {{ end -}} - -{{- .Text | safeHTML -}} \ No newline at end of file +{{- .Text | safeHTML -}} \ No newline at end of file