diff --git a/package.json b/package.json index a209786acb..32e45fd083 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "docs": "npm-run-all docs-build docs-lint", "docs-build": "hugo --cleanDestinationDir", "docs-compile": "npm run docs-build", - "docs-production": "cross-env HUGO_ENV=production npm run docs-build", "docs-linkinator": "linkinator _gh_pages --recurse --silent --skip \"^(?!http://localhost)\"", "docs-vnu": "node build/vnu-jar.js", "docs-lint": "npm-run-all --parallel docs-vnu docs-linkinator", @@ -57,13 +56,13 @@ "docs-serve-only": "serve _gh_pages --listen 9001", "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", "update-deps": "ncu -u -x karma-browserstack-launcher,popper.js && npm update && echo Manually update site/assets/js/vendor", - "release": "npm-run-all dist release-sri release-zip docs-production", + "release": "npm-run-all dist release-sri release-zip docs-build", "release-sri": "node build/generate-sri.js", "release-version": "node build/change-version.js", "release-zip": "cross-env-shell \"rm -rf bootstrap-$npm_package_version-dist && cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && rm -rf bootstrap-$npm_package_version-dist\"", "dist": "npm-run-all --parallel css js", "test": "npm-run-all lint dist js-test docs-build docs-lint", - "netlify": "npm-run-all dist release-sri docs-production", + "netlify": "npm-run-all dist release-sri docs-build", "watch": "npm-run-all --parallel watch-*", "watch-css-main": "nodemon --watch scss/ --ext scss --exec \"npm-run-all css-lint css-compile css-prefix\"", "watch-css-docs": "nodemon --watch site/assets/scss/ --ext scss --exec \"npm run css-lint\"", diff --git a/site/layouts/_default/examples.html b/site/layouts/_default/examples.html index 5e2e58ea8e..6142e29ad5 100644 --- a/site/layouts/_default/examples.html +++ b/site/layouts/_default/examples.html @@ -43,7 +43,7 @@ {{ .Content }} {{ if ne .Page.Params.include_js false -}} - {{- if eq (getenv "HUGO_ENV") "production" -}} + {{- if eq hugo.Environment "production" -}} {{- else -}} diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html index e458d47e2d..afe7bd8121 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" -}} {{ else -}} @@ -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 }} diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html index 705f5fa738..f61c07f762 100644 --- a/site/layouts/partials/stylesheet.html +++ b/site/layouts/partials/stylesheet.html @@ -1,5 +1,5 @@ {{- "" | safeHTML }} -{{ if eq (getenv "HUGO_ENV") "production" -}} +{{ if eq hugo.Environment "production" -}} {{- else -}} @@ -10,7 +10,7 @@ {{- $sassOptions := dict "targetPath" $targetDocsCssPath "precision" 6 -}} {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}} -{{- if (eq (getenv "HUGO_ENV") "production") -}} +{{ if eq hugo.Environment "production" -}} {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} diff --git a/site/layouts/robots.txt b/site/layouts/robots.txt index 5dd1a294ec..271b4f1b7b 100644 --- a/site/layouts/robots.txt +++ b/site/layouts/robots.txt @@ -1,6 +1,6 @@ # www.robotstxt.org -{{- $isProduction := eq (getenv "HUGO_ENV") "production" -}} +{{- $isProduction := eq hugo.Environment "production" -}} {{- $isNetlify := eq (getenv "NETLIFY") "true" -}} {{- $allowCrawling := and (not $isNetlify) $isProduction -}}