mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
Continue supporting HUGO_ENV
Revert some of the changes done in a7324c5f15effe5d2b78992fc7b829b29152a7f9. Continue supporting the environment variable "HUGO_ENV" which doesn't affect Hugo while still supporting the new, official ways of setting the environment. <body> will however get a class named by the official environment only since it would be confusing to add both a "development" class and a "production" class at the same time if the site is rendered using this command for instance: $ HUGO_ENV=production hugo server
This commit is contained in:
parent
f3388f4fef
commit
457e8fdcee
@ -8,7 +8,7 @@
|
|||||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||||
{{ .Hugo.Generator }}
|
{{ .Hugo.Generator }}
|
||||||
{{/* NOTE: For Production make sure you add `HUGO_ENVIRONMENT="production"` before your build command */}}
|
{{/* NOTE: For Production make sure you add `HUGO_ENVIRONMENT="production"` before your build command */}}
|
||||||
{{ if eq hugo.Environment "production" }}
|
{{ if eq (getenv "HUGO_ENV") "production" | or (eq hugo.Environment "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">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
# robotstxt.org - if environment is not production robots will be disallowed.
|
# robotstxt.org - if environment is not production robots will be disallowed.
|
||||||
{{ if eq hugo.Environment "production" }}
|
{{ if eq (getenv "HUGO_ENV") "production" | or (eq hugo.Environment "production") }}
|
||||||
Disallow:
|
Disallow:
|
||||||
{{ else }}
|
{{ else }}
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
Loading…
x
Reference in New Issue
Block a user