HUGO build generates wierd URL path

I have created a test repo on git here and if I serve it locally the PATH for 1st post looks like it supposed to look: /posts/hello-world/ but when I build it with netlify the path turns to /posts/first/hello-world/ (notice /first/ – it shouldn’t be there) which is undesirable, you can see it here https://pensive-banach-621829.netlify.com/posts/first/hello-world/
I asked this question on HUGO forum, but looks like it’s something with netlify settings.

Hi Mikhail,

Our hugo is the same hugo used elsewhere - but have you made sure that:

  1. you have all changes from your local copy committed to git? Often folks have local changes to netlify.toml or templates that aren’t pushed.

  2. we’re using the right hugo version? You don’t seem to be specifying one. What version do you use locally? We use the one mentioned here by default, which probably doesn’t match yours (since it’s a year or so old :)) https://github.com/netlify/build-image/blob/xenial/included_software.md . Here’s how to set one explicitly: https://docs.netlify.com/configure-builds/environment-variables/#netlify-configuration-variables (HUGO_VERSION, set here: https://app.netlify.com/sites/pensive-banach-621829/settings/deploys#environment-variables)

1 Like

You were right I somehow missed this, I mean I read somewhere that you have to change the version of Image (like Ubuntu 14 to 16) to get the newer version of the Hugo, but I guess I misunderstood that and was looking in wrong place :slight_smile: Now it works as intended.

1 Like