mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-25 03:51:37 +01:00
layouts: use hugo.IsProduction
This commit is contained in:
parent
153740bbac
commit
bf79c208ae
@ -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)) }}
|
||||
<img srcset="{{- range $size := $sizes -}}
|
||||
{{- if (ge $cover.Width $size) -}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<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">
|
||||
{{- else }}
|
||||
<meta name=" robots" content="noindex, nofollow">
|
||||
@ -76,7 +76,7 @@
|
||||
{{ end }}
|
||||
{{- partial "extend_head.html" . -}}
|
||||
<!-- 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_news.html" . }}
|
||||
{{- template "partials/templates/opengraph.html" . }}
|
||||
|
@ -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: /
|
||||
|
Loading…
Reference in New Issue
Block a user