Search code examples
htmlcsshugo

Is a theme required for Hugo?


I'm looking to use a static site generator to build a few upcoming websites and was messing around with Jekyll and Hugo. The sites will be custom Bootstrap style designs and not anything from prebuilt themes. After messing around with the two I like the looks of using Hugo.

Anyway, going through their documentation I came across a question. Am I required to create a 'theme' for each of these sites or can I keep everything in the global /layouts, /static, /archetypes, etc folders?

I'm not looking to package these designs up as reusable themes and it just seems like unnecessary convolutions to nest things even deeper as I try and remember the order Hugo prioritizes these template files over others.


Solution

  • Hugo does not ship with a default theme, so you'd have to either write your own or use a prebuilt one. The Hugo documentation lists the priority in which template files are checked in order to determine how the content is rendered.

    The templates located in the global layouts folder takes priority over the ones in themes/<theme name>/layouts.

    So based on that, you can in fact put your template files only in the global layouts folder.