diff --git a/layouts/partials/cover.html b/layouts/partials/cover.html index d44581b5..86ee4894 100644 --- a/layouts/partials/cover.html +++ b/layouts/partials/cover.html @@ -9,7 +9,7 @@ rel="noopener noreferrer">{{ end -}} {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }} - {{- $prod := (eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")) }} + {{- $prod := (hugo.IsProduction | or (eq .Site.Params.env "production")) }} {{- if (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false) (eq $prod true)) }} -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} {{- else }} @@ -76,7 +76,7 @@ {{ end }} {{- partial "extend_head.html" . -}} -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} {{- template "_internal/google_analytics_async.html" . }} {{- template "_internal/google_news.html" . }} {{- template "partials/templates/opengraph.html" . }} diff --git a/layouts/robots.txt b/layouts/robots.txt index 35f59d15..da3e7e0d 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,5 +1,5 @@ User-agent: * -{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} Disallow: {{- else }} Disallow: /