Using Hugo Without a Theme

Hugo is a very powerful site generator, and includes plenty of features for large static sites. Most tutorials focus on how to quickly get a nice-looking site using a theme.

What if you’re coming from the other direction, however? Maybe you want to extend an existing single-page site to multiple pages without totally structuring it (or copying and pasting the common bits). Or maybe you’re perfectly happy to write your own CSS. Hugo is still a great tool!

Just show me an example!

You don’t have to read any of this post if you don’t want to – just see the hugo-skel repository in Github.

The explanation

(This isn’t meant to be a standalone post – It’s helpful to work through the Hugo quickstart guide, at least, to get familiar with Hugo’s terminology and basic structure.)

The gist of it is, look at the base template lookup order, which shows that you can use the layouts directory instead of the themes directory to find templates.

That’s it! Now you’ve got all the power of Hugo’s template engine, without anything controlling your formatting.

All of this, along with an example of using Hugo’s menu system, is in the hugo-skel git repo. I tested this out with Hugo 0.54.0.


Next Post: Some handy jq tricks

Previous Post: Painless and secure SSH key management