There is a new (0.32 at this time) version of Hugo
that has just been released.
It was asked in the community how to handle this situation to test out t
If you do not setup a variable HUGO_VERSION
on Netlify
it defaults to version 0.17
of HUGO
.
To target your builds Netlify has a custom variables field in the online console for your site. This will be enough for simple sites that need to target all workflow builds.
Netlify
allows for a config file (netlify.toml
) at the root of your build package path that will tell it what configurations to use and will overwrite any build environment variables you setup in the simple example above.
netlify.toml
example for Hugo
[build]
publish = "public"
command = "hugo"
# build a preview of the site [hugo --buildFuture]
[context.deploy-preview]
command = "hugo --buildFuture"
# The default version you use for production if you don't use context
[build.environment]
HUGO_VERSION = "0.29"
# The version you use for production
[context.production.environment]
HUGO_VERSION = "0.29"
# you can lock a version of hugo for a deploy preview
[context.deploy-preview.environment]
HUGO_VERSION = "0.32"
# you can lock a version of hugo for a branch-deploy (other than previews)
[context.branch-deploy.environment]
HUGO_VERSION = "0.32"
Netlify
allows like NODE_VERSION
Hugo
templates!Netlify
Here