Hugo Static vs Assets Folders

Published: 2024-06-09 | Updated: 2024-06-10

When I first started creating this site in Hugo I made a ton of decisions about where in Hugo’s default folder structure I would store my site assets - things like the favicons, javascript files, and my scss/css files. I made some mistakes. This post is another short one to quickly get you past my self-inflicted points of pain on these matters.

Here’s what I learned in a nutshell:

When I ask Hugo to build a site, it resizes images , it transpiles my .scss and .js and .ts files, and it fingerprints / compresses / minimizes everything. The process is called pipelining and it’s what Hugo excells at. Hugo’s pipeline is served from the assets folder. None of the files in /assets which aren’t processed by Hugo during the build process will actually make it into \public during build.

But all of the assets in the /static folder will be included into \public during build.

So here, by way of example is what I generally keep in /assets and /static