mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Fix regression when loading config -e is empty or HUGO_ENV or HUGO_ENVIRONMENT is set
Fixes #11013
This commit is contained in:
@@ -5,13 +5,13 @@ stdout 'Pages.*|1'
|
||||
stdout 'Total in'
|
||||
checkfile public/index.html
|
||||
checkfile public/p1/index.html
|
||||
grep 'IsServer: false' public/index.html
|
||||
grep 'IsServer: false;IsProduction: true' public/index.html
|
||||
|
||||
-- hugo.toml --
|
||||
baseURL = "http://example.org/"
|
||||
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
|
||||
-- layouts/index.html --
|
||||
Home|IsServer: {{ .Site.IsServer }}|
|
||||
Home|IsServer: {{ .Site.IsServer }};IsProduction: {{ hugo.IsProduction }}|
|
||||
-- layouts/_default/single.html --
|
||||
Title: {{ .Title }}
|
||||
-- content/p1.md --
|
||||
|
19
testscripts/commands/hugo_configdev_env.txt
Normal file
19
testscripts/commands/hugo_configdev_env.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
# Test the hugo command.
|
||||
env HUGO_ENV=development
|
||||
|
||||
hugo
|
||||
grep 'myparam: dev§' public/index.html
|
||||
|
||||
-- hugo.toml --
|
||||
baseURL = "http://example.org/"
|
||||
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
|
||||
-- layouts/index.html --
|
||||
myparam: {{ site.Params.myparam }}§
|
||||
-- layouts/_default/single.html --
|
||||
Title: {{ .Title }}
|
||||
-- config/development/params.toml --
|
||||
myparam = "dev"
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: "P1"
|
||||
---
|
22
testscripts/commands/hugo_configdev_environment.txt
Normal file
22
testscripts/commands/hugo_configdev_environment.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# Test the hugo command.
|
||||
env HUGO_ENVIRONMENT=development
|
||||
|
||||
hugo
|
||||
grep 'myparam: dev§' public/index.html
|
||||
|
||||
hugo -e production
|
||||
grep 'myparam: §' public/index.html
|
||||
|
||||
-- hugo.toml --
|
||||
baseURL = "http://example.org/"
|
||||
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
|
||||
-- layouts/index.html --
|
||||
myparam: {{ site.Params.myparam }}§
|
||||
-- layouts/_default/single.html --
|
||||
Title: {{ .Title }}
|
||||
-- config/development/params.toml --
|
||||
myparam = "dev"
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: "P1"
|
||||
---
|
18
testscripts/commands/hugo_configprod.txt
Normal file
18
testscripts/commands/hugo_configprod.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
# Test the hugo command.
|
||||
|
||||
hugo
|
||||
grep 'myparam: §' public/index.html
|
||||
|
||||
-- hugo.toml --
|
||||
baseURL = "http://example.org/"
|
||||
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
|
||||
-- layouts/index.html --
|
||||
myparam: {{ site.Params.myparam }}§
|
||||
-- layouts/_default/single.html --
|
||||
Title: {{ .Title }}
|
||||
-- config/development/params.toml --
|
||||
myparam = "dev"
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: "P1"
|
||||
---
|
Reference in New Issue
Block a user