
If an environment variable (`HUGO_VERSION` in this case) has the same value for all contexts (production, deploy-preview & branch-deploy), then there is no need to specify it for each context. Specifying it once under [build.environment] should be enough. From https://docs.netlify.com/configure-builds/file-based-configuration/#deploy-contexts : "any property of a context-aware key, such as [build] or [[plugins]], will be applied to all contexts unless the same property key is present in a more specific context."
19 lines
476 B
TOML
19 lines
476 B
TOML
[build]
|
|
command = "cd exampleSite && hugo --gc --minify -D -b $URL"
|
|
publish = "exampleSite/public"
|
|
|
|
[build.environment]
|
|
HUGO_VERSION = "0.112.7"
|
|
HUGO_THEMESDIR = "../.."
|
|
HUGO_THEME = "repo"
|
|
TZ = "Australia/Melbourne"
|
|
|
|
[context.production.environment]
|
|
HUGO_ENV = "production"
|
|
|
|
[context.deploy-preview]
|
|
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"
|
|
|
|
[context.branch-deploy]
|
|
command = "cd exampleSite && hugo --gc --minify -D -b $DEPLOY_PRIME_URL"
|