Hugo builds with incorrect version

I’ve updated my production site from Hugo 0.47 to Hugo 0.76, but Netlify deploy continues to pull Hugo 0.47.

I’ve set the site config.toml to
command = “hugo”
context = “production”
publish = “public”

HUGO_VERSION = “0.76.0”

HUGO_VERSION = “0.76.0”
HUGO_ENV = “production”

As I understand, the version specified in [build.environment] should apply to all builds and the version specified in [context.production.environment] should apply to an environment (production, in this case).

I’ve also specified a Deploy Environment value of HUGO_VERSION 0.76.0 in the Netlify Site Admin.

Hugo version reported on production page:
Hugo version reported in build log:
Hugo version specified in config.toml:
Hugo version specified in Netlify Admin:

For what it’s worth, the netlify build is on Xenial 16.04. This is not a branch deploy, just master/production.

What am I missing here? How do we get Netlify to build with the specified Hugo version?

Thanks for reading!

The part from the [build] should go in a file called netlify.toml and not Hugo’s config.toml. With that being said, I don’t know why it’s not working even though you have set the environment variable in Netlify UI. But try with netlify.toml and let us know.

1 Like

Yes, sort of like I was looking for my glasses when all the while they were on my head. [build] directives moved to netlify.toml and works as advertised


1 Like