Hugo Production Deployment version 0.68.3 with tranquilpeak theme

I am switching themes on my site, when I run the production deploy, it does not display correctly. The production deployment command I am using is hugo --gc --minify

The deployment itself completes successfully. As seen on: dina.technology

The staging deploy using hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL the site comes up as expected. As seen on: https://5e8dd98c93ad810006c4c859–keen-pasteur-27ab21.netlify.com

My localhost environment also works as expected.

My netlify.toml looks like this:

[build.environment]

publish = "public"

command = "hugo --gc --minify"

[context.production.environment]

HUGO_VERSION = "0.68.3"

HUGO_ENV = "production"

HUGO_ENABLEGITINFO = "true"

[context.split1]

command = "hugo --gc --minify --enableGitInfo"

[context.split1.environment]

HUGO_VERSION = "0.68.3"

HUGO_ENV = "production"

[context.deploy-preview]

command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]

HUGO_VERSION = "0.68.3"

I had to update my production command deployment to include the production URL explicitly hugo --gc --minify --buildFuture -b $URL

It also seems like the command in Netlify UI is getting picked up vs. what is defined int he netlify.toml

Hi, @charmed, I’m glad to learn you got it working. I do want to clarify the build command in netlify.toml will always take precedence over what is defined in the UI.

I think the netlify.toml version isn’t being detected at all. That is because the build command is defined like this:

[build.environment]

  publish = "public"

  command = "hugo --gc --minify"

However, the correct syntax is this (with the updated build command) below:

[build]

  publish = "public"

  command = "hugo --gc --minify --buildFuture -b $URL"

Would you please try making that edit and let us know if the changes in the netlify.toml file are detected? You might test by editing the command to echo something before building like so:

  command = "echo 'this is the toml file' ; hugo --gc --minify --buildFuture -b $URL"
  • Note the use of the single quotes inside the double quotes.

If there are other questions about this, please let us know.

Thank you @luke! Confirming the updates in the netlify.toml got picked up and the deployment is now actually using the file as expected.