aboutsummaryrefslogtreecommitdiff
path: root/site
diff options
context:
space:
mode:
Diffstat (limited to 'site')
-rw-r--r--site/layouts/_default/examples.html2
-rw-r--r--site/layouts/partials/scripts.html4
-rw-r--r--site/layouts/partials/stylesheet.html4
-rw-r--r--site/layouts/robots.txt3
4 files changed, 6 insertions, 7 deletions
diff --git a/site/layouts/_default/examples.html b/site/layouts/_default/examples.html
index 19aad368d..3b048a9d4 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 -}}
<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>
diff --git a/site/layouts/partials/scripts.html b/site/layouts/partials/scripts.html
index facb7d384..046f659a9 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 -}}
<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 }}
diff --git a/site/layouts/partials/stylesheet.html b/site/layouts/partials/stylesheet.html
index d07f9a5f2..f675d7212 100644
--- a/site/layouts/partials/stylesheet.html
+++ b/site/layouts/partials/stylesheet.html
@@ -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 -}}
diff --git a/site/layouts/robots.txt b/site/layouts/robots.txt
index 271b4f1b7..bafd23893 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