From 0ff9c72b22e5f14f9217e187f448d399be0b3f3b Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 4 Feb 2021 08:40:20 +0200 Subject: [PATCH] Use `path.Join` when joining paths --- site/content/docs/5.0/forms/validation.md | 2 +- site/layouts/partials/scripts.html | 2 +- site/layouts/partials/stylesheet.html | 2 +- site/layouts/shortcodes/docsref.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/site/content/docs/5.0/forms/validation.md b/site/content/docs/5.0/forms/validation.md index 128f6b408095..5731c57d8b96 100644 --- a/site/content/docs/5.0/forms/validation.md +++ b/site/content/docs/5.0/forms/validation.md @@ -103,7 +103,7 @@ Custom feedback styles apply custom colors, borders, focus styles, and backgroun {{< example lang="js" show_preview="false" >}} {{< js.inline >}} -{{- readFile (printf "site/static/docs/%s/assets/js/validate-forms.js" .Site.Params.docs_version) -}} +{{- readFile (path.Join "site/static/docs" .Site.Params.docs_version "assets/js/validate-forms.js") -}} {{< /js.inline >}} {{< /example >}} diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html index d7c6946417b8..d25add3ff44e 100644 --- a/site/layouts/partials/scripts.html +++ b/site/layouts/partials/scripts.html @@ -10,7 +10,7 @@ {{- $vendor := resources.Match "js/vendor/*.js" -}} {{- $js := resources.Match "js/*.js" -}} -{{- $targetDocsJSPath := printf "/docs/%s/assets/js/docs.js" .Site.Params.docs_version -}} +{{- $targetDocsJSPath := path.Join "/docs" .Site.Params.docs_version "assets/js/docs.js" -}} {{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}} {{- if eq hugo.Environment "production" -}} diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html index 83b30f452af2..cc447338366c 100644 --- a/site/layouts/partials/stylesheet.html +++ b/site/layouts/partials/stylesheet.html @@ -10,7 +10,7 @@ {{- end }} {{- if (ne .Page.Layout "examples") }} -{{- $targetDocsCssPath := printf "/docs/%s/assets/css/docs.css" .Site.Params.docs_version -}} +{{- $targetDocsCssPath := path.Join "/docs" .Site.Params.docs_version "assets/css/docs.css" -}} {{- $sassOptions := dict "targetPath" $targetDocsCssPath "outputStyle" "expanded" "precision" 6 -}} {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}} diff --git a/site/layouts/shortcodes/docsref.html b/site/layouts/shortcodes/docsref.html index 88e43d1725e0..2379de2b12e1 100644 --- a/site/layouts/shortcodes/docsref.html +++ b/site/layouts/shortcodes/docsref.html @@ -1 +1 @@ -{{- relref . ((printf "docs/%s%s" $.Site.Params.docs_version (.Get 0)) | relURL) -}} +{{- relref . ((path.Join "docs" $.Site.Params.docs_version (.Get 0)) | relURL) -}}