Hugo pages site images not working

I have a hugo site deployed w/ github to pages, it builds properly, however my background images are simply not rendered.

running locally with hugo server works fine and the images are as expected. I have tried placing them both under /assets/images and /static/images but in either case it works locally but not on the hosted site.

I have manually set the hugo and go version variables to match my local environment.

Any help is much appreciated.

Are the images 404ing? Is it possible you didn’t set baseURL, or set it incorrectly, and the image links are being generated wrong?

1 Like

I think I have a hint here, the image it is trying to load is pointing at the production domain and not the preview deployment. How do I get it to point at the correct domain?

Figured it out, removing the baseURL from my config.toml and setting it at runtime in the build command settings was the fix.

hugo -b $CF_PAGES_URL