]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Switch to using `hugo.IsProduction` (#39763)
authorXhmikosR <xhmikosr@gmail.com>
Fri, 8 Mar 2024 10:41:17 +0000 (12:41 +0200)
committerGitHub <noreply@github.com>
Fri, 8 Mar 2024 10:41:17 +0000 (12:41 +0200)
site/layouts/_default/examples.html
site/layouts/partials/scripts.html
site/layouts/partials/stylesheet.html
site/layouts/robots.txt

index 19aad368d6f58c4a40c4fda22cc76b4020a60511..3b048a9d441435e96a200a700ae692ab8b5e1336 100644 (file)
 
     {{ .Content }}
 
-    {{- if eq hugo.Environment "production" -}}
+    {{- if hugo.IsProduction -}}
       <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" {{ printf "integrity=%q" .Site.Params.cdn.js_bundle_hash | safeHTMLAttr }}></script>
     {{- else -}}
       <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
index facb7d384a8c79b6fdf685aa6466e999b33ab2bf..046f659a947051cf43caae7e68807709709d14cc 100644 (file)
@@ -1,4 +1,4 @@
-{{ if eq hugo.Environment "production" -}}
+{{ if hugo.IsProduction -}}
   <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" {{ printf "integrity=%q" .Site.Params.cdn.js_bundle_hash | safeHTMLAttr }}></script>
 {{ else -}}
   <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
@@ -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 }}
 
index d07f9a5f29445f2b2e1e5d1a88191228f5484334..f675d7212502b576f89aeb27de6c620d6ea0efc4 100644 (file)
@@ -1,6 +1,6 @@
 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3">
 
-{{ if eq hugo.Environment "production" -}}
+{{ if hugo.IsProduction -}}
 {{ if eq .Page.Params.direction "rtl" -}}
 <link href="/docs/{{ .Site.Params.docs_version }}/dist/css/bootstrap.rtl.min.css" rel="stylesheet" {{ printf "integrity=%q" .Site.Params.cdn.css_rtl_hash | safeHTMLAttr }}>
 {{- 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 -}}
 
index 271b4f1b7b4275649d408879edca9723c10621b2..bafd23893dc927391680f608be3d218bad9f1634 100644 (file)
@@ -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