From c5ba5b7aef357901fce3981e3da26365462020db Mon Sep 17 00:00:00 2001 From: Chang-Yen Tseng <10328757+Summon528@users.noreply.github.com> Date: Tue, 15 Nov 2022 11:07:18 -0600 Subject: [PATCH] Use path.Join to construct hugo links (#92) Use path.Join so that it will render correctly on Windows (path.Join will convert Windows backslash to forward slash) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 753d436..5be964e 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ And `layouts/_default/_markup/render-image.html` for images: {{- if strings.HasSuffix $url.Path ".md" -}} {{- relref .Page .Destination | safeURL -}} {{- else -}} - {{- printf "/%s%s" .Page.File.Dir .Destination | safeURL -}} + {{- path.Join "/" .Page.File.Dir .Destination | safeURL -}} {{- end -}} {{- else -}} {{- .Destination | safeURL -}}