diff options
| author | XhmikosR <[email protected]> | 2020-02-22 08:54:43 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-02-22 08:54:43 +0200 |
| commit | b8ffcdf9a4b8d61ef896c102732e15af39e883b5 (patch) | |
| tree | 913d0533f910408580e70dbacbfa6009521906ca /site/layouts/partials/scripts.html | |
| parent | 9d50c6a18fcfd2e42ccc4e7b29d887c574bfadea (diff) | |
| download | bootstrap-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.html | 4 |
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 }} |
