Hugo: Warning when building site generated using hugo new site

Created on 6 Feb 2020  Â·  1Comment  Â·  Source: gohugoio/hugo

What version of Hugo are you using (hugo version)?

v0.64.0-241DB8F7 linux/amd64 BuildDate: 2020-02-04T09:10:23Z

Does this issue reproduce with the latest release?

Yes.

Platform

Pop!_OS 19.10 (based on Ubuntu 19.10)

To reproduce

  1. hugo new site my-site
  2. cd my-site
  3. hugo

What should happen

Output should resemble the following, with no errors or warnings on a newly-generated site.

Building sites…

                   | EN  
-------------------+-----
  Pages            |  3  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  0  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 12 ms

What actually happens

Output resembles the following with three cryptic warnings:

Building sites … WARN 2020/02/06 13:03:11 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/02/06 13:03:11 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/02/06 13:03:11 found no layout file for "HTML" for kind "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

                   | EN  
-------------------+-----
  Pages            |  3  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  0  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 12 ms

Proposed fix

Fix whatever is causing the warnings so that a new site, generated using the official command, builds without warnings or errors.

The minimum fix appears to be the following:

  1. Add an empty _index.html_ file into the generated _layouts/_ folder
  2. Add disableKinds = ['taxonomyTerm'] to the generated _config.toml_ file.

With those two alterations, a site generated using hugo new site builds without warnings or errors.

The above is most likely __not__ also the ideal fix, which might include having the generated index.html file contain some useful Getting Started information for steps the person can take next to start customising the site.

Bug

Most helpful comment

Funny enough disableKinds is supposed to fix this, however in my config.yaml I have the following and I still get this warning for both kinds (layout file doesn't exist –but then, it shouldn't be needing it as OP notes).

disableKinds:
- taxonomy
- taxonomyTerm

>All comments

Funny enough disableKinds is supposed to fix this, however in my config.yaml I have the following and I still get this warning for both kinds (layout file doesn't exist –but then, it shouldn't be needing it as OP notes).

disableKinds:
- taxonomy
- taxonomyTerm
Was this page helpful?
0 / 5 - 0 ratings

Related issues

arikroc picture arikroc  Â·  3Comments

nikolas picture nikolas  Â·  3Comments

antifuchs picture antifuchs  Â·  3Comments

VoidingWarranties picture VoidingWarranties  Â·  3Comments

vielmetti picture vielmetti  Â·  3Comments