Skip to content

Commit

Permalink
Use path.Join when joining paths
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 4, 2021
1 parent 492ff78 commit 124b867
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion site/content/docs/5.0/forms/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}

Expand Down
2 changes: 1 addition & 1 deletion site/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

Expand Down
2 changes: 1 addition & 1 deletion site/layouts/shortcodes/docsref.html
Original file line number Diff line number Diff line change
@@ -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) -}}

0 comments on commit 124b867

Please sign in to comment.