in Hugo, Web Development

Rendering a static site in Hugo

I am working on a project using the Hugo static site generator with the Book theme. When I looked at this command page, it looked like typing the word “hugo” at the base directory of my site would render the site to the public folder. However, when I did that, no index.html file was generated – grr! After some more searching, I figured out that if you are using a theme (like I am), the theme needs to be specified (“hugo -t book”). Once I added that flag, it worked! Oh, the joy….

Write a Comment

Comment

  1. @AndySylvester You may have figured this out, but if not…You can also put theme = "book" in the config.toml file so you don’t need to add the flag every time you render.

  2. @AndySylvester Most themes display posts in reverse chronological order by default, I would think. Perhaps “book” is different. I’ve not done it, but my guess is you’ll need to tinker with the template /layouts/posts/list.html and probably either remove sort or add .reverse to the pagination bits. Sorry I’m not more useful.