Ignore or commit `resources` folder?

Hello everyone,

is it recommended to add the resources folder to .gitignore or should I commit that folder? I am deploying to Netlify.

In an older topic the solution was to not commit the folder. But in the Hugo Docs repository on GitHub it is committed.

Thanks!

I think this would depend on whether your build machine persists across builds. Many CI pipelines use ephemeral containers by default.

If you do a lot of asset processing (especially images), builds can take minutes! If you discard the build cache each time, you lose one of Hugo’s key strengths.

My build machine doesn’t self destruct (LXD container) so Hugo can rely on the resources/ dir being there from prior builds. In that case not committing build artifacts to the source repo is definitely the cleaner choice.

1 Like