mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-07 16:42:45 +00:00
fix: use hugo.Environment
This commit is contained in:
parent
673abbaba2
commit
fc8a04569a
@ -9,7 +9,7 @@
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
{{ hugo.Generator }}
|
||||
{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}}
|
||||
{{ $production := eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }}
|
||||
{{ $production := eq (getenv "HUGO_ENV") "production" | or (eq hugo.Environment "production") }}
|
||||
{{ $public := not .Params.private }}
|
||||
{{ if and $production $public }}
|
||||
<meta name="robots" content="index, follow">
|
||||
@ -51,7 +51,7 @@
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq hugo.Environment "production") }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end }}
|
||||
{{ block "head" . }}{{ partial "head-additions.html" . }}{{ end }}
|
||||
|
@ -68,7 +68,7 @@ css asset directory we (unless condition below) add to aforementioned slice */}}
|
||||
{{ $options := dict "enableSourceMap" true "precision" 6 }}
|
||||
{{ $style = $style | resources.ToCSS $options | minify }}
|
||||
{{/* We fingerprint in production for cache busting purposes */}}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" }}
|
||||
{{ if (eq hugo.Environment "production") }}
|
||||
{{ $style = $style | fingerprint }}
|
||||
{{ end }}
|
||||
{{/* We're ready to set returning variable with resulting resource */}}
|
||||
|
@ -1,6 +1,6 @@
|
||||
User-agent: *
|
||||
{{/* robotstxt.org - if ENV production variable is false robots will be disallowed. */ -}}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") -}}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq hugo.Environment "production") -}}
|
||||
Allow: /
|
||||
Sitemap: {{ "/sitemap.xml" | absURL }}
|
||||
{{ else -}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user