Hugo site does not build correctly

Hi, I am trying to deploy my simple blog site that uses Hugo and Bootstrap to Cloudflare Pages. However, none of the images work as well as some internal links. When I test it out on Localhost, it works. Does anyone have experience with this issue and how to solve it?
Thanks in advance

Make sure, in your project settings, you set an environment variable HUGO_VERSION to the version that you are using. Otherwise it uses a very old version by default. If you’re using any Javascript or npm commands during the build, also set NODE_VERSION to 17 while you’re in there.

1 Like

Thank you, I followed your advise but it still doesn’t build correctly. Are there certain scenarios that Cloudflare Pages can’t replicate in the Hugo build? The weird thing is that the link to one blog post does not work nor do the images, but the content summary appears on the front page.

Is your repo public? It would help us debug quicker.

Here is the repo[Preformatted text](

Looks like your repo is private.

My bad, I made it public now

So this is what I got working images are loading for me fine, and I don’t know if that is what you are expecting to see.
This is my build config

My environment variables

One thing I did and recommend you do is delete the public folder and add .gitignore to prevent it from being committed. You don’t want to serve old resources.
Also let me know when you want me to delete the repo and pages project.


Thank you so much for your help! It works. Deleting the old public folder and I seemed to have had the wrong version number somehow.
I appreciate your help very much - I guess you can tell that I’m a newbie at this.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.