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)
This commit is contained in:
Chang-Yen Tseng 2022-11-15 11:07:18 -06:00 committed by GitHub
parent 9bce284697
commit c5ba5b7aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,7 +217,7 @@ And `layouts/_default/_markup/render-image.html` for images:
{{- if strings.HasSuffix $url.Path ".md" -}} {{- if strings.HasSuffix $url.Path ".md" -}}
{{- relref .Page .Destination | safeURL -}} {{- relref .Page .Destination | safeURL -}}
{{- else -}} {{- else -}}
{{- printf "/%s%s" .Page.File.Dir .Destination | safeURL -}} {{- path.Join "/" .Page.File.Dir .Destination | safeURL -}}
{{- end -}} {{- end -}}
{{- else -}} {{- else -}}
{{- .Destination | safeURL -}} {{- .Destination | safeURL -}}