Having discovered Hugo while building this blog, I’ve introduced it to engineering at work to build our internal documentation. Due to the need to ensure confidentiality, I run our Hugo blog on a micro instance on AWS with IP restrictions and AD authentication. Currently, this means that I have a little shell script that checks the GitHub repo every so often and then pulls and outputs the latest version. The intent is to move it to Jenkins and build and deploy, but that wasn’t happening on a Saturday at midnight when I was setting it up.

While first setting it up, I noticed that Hugo only output the XML files and the version available on Ubuntu 18.04 which is 0.40 doesn’t tell you what the issue is. Upgrading to the latest version 0.58 provides a warning that no layouts are present.

1
2
3
4
5
6
7
8
Building sites … WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2019/09/07 04:17:54 found no layout file for "JSON" for "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

This made no sense since I was using the popular docDock theme, which provided all the specified layouts. Additionally, it “worked on my machine.” At the end it turned out that since I was using the theme as a submodule as opposed to a checkout, git had to be told to clone the theme with the repository. This can be accomplished via a simple command at the time of cloning the repository by using the following command:

1
git clone --recursive git@github.com:Orgname/repoName.git

The build then outputs the proper HTML.