aboutsummaryrefslogtreecommitdiff
path: root/site/layouts/partials/scripts.html
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2020-02-22 08:54:43 +0200
committerGitHub <[email protected]>2020-02-22 08:54:43 +0200
commitb8ffcdf9a4b8d61ef896c102732e15af39e883b5 (patch)
tree913d0533f910408580e70dbacbfa6009521906ca /site/layouts/partials/scripts.html
parent9d50c6a18fcfd2e42ccc4e7b29d887c574bfadea (diff)
downloadbootstrap-b8ffcdf9a4b8d61ef896c102732e15af39e883b5.tar.xz
bootstrap-b8ffcdf9a4b8d61ef896c102732e15af39e883b5.zip
Use `hugo.Environment` instead of `getenv` (#29240)
This is set automatically to "development" when the local server is running, and to "production" when Hugo builds the site.
Diffstat (limited to 'site/layouts/partials/scripts.html')
-rw-r--r--site/layouts/partials/scripts.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html
index e458d47e2..afe7bd812 100644
--- a/site/layouts/partials/scripts.html
+++ b/site/layouts/partials/scripts.html
@@ -1,4 +1,4 @@
-{{ if eq (getenv "HUGO_ENV") "production" -}}
+{{ if eq hugo.Environment "production" -}}
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
{{ else -}}
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
@@ -13,7 +13,7 @@
{{- $targetDocsJSPath := printf "/docs/%s/assets/js/docs.js" .Site.Params.docs_version -}}
{{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}}
-{{- if (eq (getenv "HUGO_ENV") "production") -}}
+{{- if eq hugo.Environment "production" -}}
{{- $docsJs = $docsJs | resources.Minify -}}
{{- end }}