layouts: use hugo.IsProduction
This commit is contained in:
parent
153740bbac
commit
bf79c208ae
@ -9,7 +9,7 @@
|
|||||||
rel="noopener noreferrer">{{ end -}}
|
rel="noopener noreferrer">{{ end -}}
|
||||||
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
|
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
|
||||||
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") }}
|
{{- $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 (and (in $processableFormats $cover.MediaType.SubType) (ne .Site.Params.cover.responsiveImages false) (eq $prod true)) }}
|
||||||
<img srcset="{{- range $size := $sizes -}}
|
<img srcset="{{- range $size := $sizes -}}
|
||||||
{{- if (ge $cover.Width $size) -}}
|
{{- if (ge $cover.Width $size) -}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
|
||||||
<meta name="robots" content="index, follow">
|
<meta name="robots" content="index, follow">
|
||||||
{{- else }}
|
{{- else }}
|
||||||
<meta name=" robots" content="noindex, nofollow">
|
<meta name=" robots" content="noindex, nofollow">
|
||||||
@ -76,7 +76,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{- partial "extend_head.html" . -}}
|
{{- partial "extend_head.html" . -}}
|
||||||
<!-- Misc -->
|
<!-- Misc -->
|
||||||
{{- 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_analytics_async.html" . }}
|
||||||
{{- template "_internal/google_news.html" . }}
|
{{- template "_internal/google_news.html" . }}
|
||||||
{{- template "partials/templates/opengraph.html" . }}
|
{{- template "partials/templates/opengraph.html" . }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
{{- if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }}
|
||||||
Disallow:
|
Disallow:
|
||||||
{{- else }}
|
{{- else }}
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
Loading…
Reference in New Issue
Block a user