From: XhmikosR Date: Fri, 8 Mar 2024 10:41:17 +0000 (+0200) Subject: Switch to using `hugo.IsProduction` (#39763) X-Git-Tag: v5.3.4~219 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=930740afbc87931475df4785c9e13e0818e8af66;p=thirdparty%2Fbootstrap.git Switch to using `hugo.IsProduction` (#39763) --- diff --git a/site/layouts/_default/examples.html b/site/layouts/_default/examples.html index 19aad368d6..3b048a9d44 100644 --- a/site/layouts/_default/examples.html +++ b/site/layouts/_default/examples.html @@ -158,7 +158,7 @@ {{ .Content }} - {{- if eq hugo.Environment "production" -}} + {{- if hugo.IsProduction -}} {{- else -}} diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html index facb7d384a..046f659a94 100644 --- a/site/layouts/partials/scripts.html +++ b/site/layouts/partials/scripts.html @@ -1,4 +1,4 @@ -{{ if eq hugo.Environment "production" -}} +{{ if hugo.IsProduction -}} {{ else -}} @@ -15,7 +15,7 @@ {{- $targetDocsJSPath := path.Join "/docs" .Site.Params.docs_version "assets/js/docs.js" -}} {{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}} -{{- if eq hugo.Environment "production" -}} +{{- if hugo.IsProduction -}} {{- $docsJs = $docsJs | resources.Minify -}} {{- end }} diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html index d07f9a5f29..f675d72125 100644 --- a/site/layouts/partials/stylesheet.html +++ b/site/layouts/partials/stylesheet.html @@ -1,6 +1,6 @@ -{{ if eq hugo.Environment "production" -}} +{{ if hugo.IsProduction -}} {{ if eq .Page.Params.direction "rtl" -}} {{- else -}} @@ -15,7 +15,7 @@ {{- $sassOptions := dict "targetPath" $targetDocsCssPath "outputStyle" "expanded" "precision" 6 -}} {{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}} -{{ if eq hugo.Environment "production" -}} +{{ if hugo.IsProduction -}} {{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}} {{- end -}} diff --git a/site/layouts/robots.txt b/site/layouts/robots.txt index 271b4f1b7b..bafd23893d 100644 --- a/site/layouts/robots.txt +++ b/site/layouts/robots.txt @@ -1,8 +1,7 @@ # www.robotstxt.org -{{- $isProduction := eq hugo.Environment "production" -}} {{- $isNetlify := eq (getenv "NETLIFY") "true" -}} -{{- $allowCrawling := and (not $isNetlify) $isProduction -}} +{{- $allowCrawling := and (not $isNetlify) hugo.IsProduction -}} {{ if $allowCrawling }} # Allow crawling of all content