Some beginner questions about themes


#1

@moorereason if this information doesn’t exist anywhere else at the moment, could you elaborate a little here on:

  • the benefits and anatomy of a theme
  • “theme-able” elements

I’ve just started looking at Hugo today, I think it looks great; theming was the one thing that seemed confusing to me. Being prompted to install a theme made me wonder:

  • Do I have to (is a theme required)?
  • Can I just make my own?
  • What constitutes a Hugo theme?
  • What’s the minimum I need as a starting point?

I naturally looked at the available themes, for something bare-bones, but they all look like I’d need to go though trying to figure out what I need, and what I don’t, which isn’t ideal.

Some sort of generated “default”, or “empty” theme might be useful. I’m thinking part of the new site process, with perhaps some questions about what features you require. But as you an see from my above questions, I don’t really know what I’m talking about at this point.


Hugo's "default" theme
#2

Some find this article helpful.

http://danbahrami.io/articles/building-a-production-website-with-hugo-and-gulp-js/


#3

Hi @smth. That thread you was from 2015, and so much has changed. It is not the place to start your journey. That place, my friend is… the docs!

And for you, specifically:

Here’s a deal: you get started with that, follow links, read everything twice, and then come back with your questions. Because if we don’t answer them in those docs, we’ll update them. :slight_smile:

Also, for getting help in these here forums, please take a gander at Requesting Help and consider those suggestions for when you are in the soup, and need code help!


#4

@maiki yeah, I didn’t realise the age of the thread until after posting (I wish Discourse would show years more prominently).

I did actually read the docs before asking my questions, and didn’t find the answers. The language of the docs sort of suggests that it is expected that you have a theme; I couldn’t see this explicitly stated anywhere however. A comment in the thread I was replying to, on the other hand, said that themes are not necessary.

So if I’m not missing something, and the docs could be improved in this respect, I’d suggest it would be to answer my original questions. Put more succinctly:

  • Do you need a theme?
  • If so, what is the minimum requirement?
  • If not, what is the advantage (beyond the obvious separation of code) of a theme?

I think the docs are really great in general, by the way. Good work.


#5

I’ll answer those questions here, and we’ll figure out where to add them:

No. Hugo uses templates to produce output from content files. A theme is a way to package those templates for reuse with other projects. If you just put your templates in layouts, you are fine. But themes are also a popular way to set up a site.

For a theme? I think an index.html. But you’ll want a few more, probably, like a single.html and list.html. Use the hugo theme generator to create a new theme. It takes less than a second, and you have a skeleton of a theme to get you started.

Only the advantages associated with such a separation: easier to share, package, resue, etc.


#6

Awesome, thanks.