Defining a layout to build a simple Hugo site

I’m just starting out with Hugo. I created a simple site made up of a half dozen .md pages (saved to content/docs/) and based on an intro “home” page whose content was added to content/ I’m using the Book theme.
The site works perfectly on my local machine running hugo server --minify --theme book, but I’m having trouble building so I can push it to a public site. Running hugo -e builds a file system in public/, but also spits out errors like:

found no layout file for “HTML” for kind “page”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination

I figured I would look for a helpful example of the template files I’d need. So I created a test site using a fresh, unchanged version of the Book theme. Once again, it ran beautifully on my local machine. But trying to build this version also failed, again complaining about template files:

Error: Error building site: “…test/content/”: failed to extract shortcode: template for shortcode “columns” not found

Is it normal that the Hugo build process is non-functioning out of the box? Are there documentation resources where I can find simple example templates to get started?

The simplest way would probably be to check back with the team that developed your theme. If shortcodes are missing, then that theme does not have them. How did those shortcodes end up in your content? If that theme runs perfectly on your local installation but fails online then the theme has some issues that need resolving.

1 Like

The shortcodes were in the sample pages/posts that came with the theme. I didn’t create any for my own pages. But template files seem to have been missing altogether.
I guess I’ll try again with a different theme. It’s nice to know that I (probably) wasn’t missing something big and stupid. :slight_smile: