Where do content images go on site build?

Hello there,

Can anyone tell me where images go once hugo build your site? For example, if I have an image stored with my markdown files in a subdirectory of content such as \content\subfolder1\subfolder2\myimage.png … Where does that image go after hugo builds the site?

…or, alternatively, how does one see the memory cache of the build that hugo last made, so I can visually check to see where it has gone? (this would be super helpful for other problems as well)

The reason I ask is I am experiencing some weird behaviour. I can find the image by trial and error, going two subfolders deep. but anything more than two deep and the image doesn’t seem to be found. I am hoping the answer to the above will help me solve this issue.

Thank you for any ideas
John

A few things:

  • just running hugo makes a public directory you can check
  • the hugo server command defaults to building in memory, but, you can use --renderToDisk to make it build to disk
  • assuming you use bundled images in a project, you can see the resources folder in the root of your project (in other words, same level as static or content or layouts or public)
  • use the --gc command to do garbage collection on your resources folder (that is, clean up resized images that are not used)
1 Like

Brilliant. Thanks Rick, you are a very helpful fellow and I am very appreciative.

Knowing these things has helped me solve a number of issues :smile:

As an aside, I found the source of my original error. It was to do with capitalisation. Rendering it to disk helped me identify that.

Thank you so much!
John

1 Like