mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +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 }}">
|
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||||
{{ hugo.Generator }}
|
{{ hugo.Generator }}
|
||||||
{{/* NOTE: For Production make sure you add `HUGO_ENV="production"` before your build command */}}
|
{{/* 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 }}
|
{{ $public := not .Params.private }}
|
||||||
{{ if and $production $public }}
|
{{ if and $production $public }}
|
||||||
<meta name="robots" content="index, follow">
|
<meta name="robots" content="index, follow">
|
||||||
@ -51,7 +51,7 @@
|
|||||||
{{- template "_internal/schema.html" . -}}
|
{{- template "_internal/schema.html" . -}}
|
||||||
{{- template "_internal/twitter_cards.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" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ block "head" . }}{{ partial "head-additions.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 }}
|
{{ $options := dict "enableSourceMap" true "precision" 6 }}
|
||||||
{{ $style = $style | resources.ToCSS $options | minify }}
|
{{ $style = $style | resources.ToCSS $options | minify }}
|
||||||
{{/* We fingerprint in production for cache busting purposes */}}
|
{{/* We fingerprint in production for cache busting purposes */}}
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" }}
|
{{ if (eq hugo.Environment "production") }}
|
||||||
{{ $style = $style | fingerprint }}
|
{{ $style = $style | fingerprint }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{/* We're ready to set returning variable with resulting resource */}}
|
{{/* We're ready to set returning variable with resulting resource */}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
{{/* robotstxt.org - if ENV production variable is false robots will be disallowed. */ -}}
|
{{/* 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: /
|
Allow: /
|
||||||
Sitemap: {{ "/sitemap.xml" | absURL }}
|
Sitemap: {{ "/sitemap.xml" | absURL }}
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user