Found no layout for "page" when building sites


#1

I run hugo -t berbera on terminal and this error will pop up. And my page is not properly built. I googled for this error , seems like no one every ran into this before. That’s weird.

  1. Link to the github repo: https://github.com/DataScientistSamChan/Blog
  2. Hugo version: Hugo Static Site Generator v0.51 windows/amd64 BuildDate: 2018-11-07T10:11:06Z
  3. Platform : windows 10 x64
  4. Below is the snippet of error.
PS D:\Google Drive\1. Active Projects\Blog> .\hugo -t berbera
Building sites … WARN 2018/11/30 19:32:50 Found no layout for "page", language "en", output format "HTML": create a template below /layouts with one of these filenames: articles/single.en.html.html, articles/single.html.html, articles/single.en.html, articles/single.html, _default/single.en.html.html, _default/single.html.html, _default/single.en.html, _default/single.html
WARN 2018/11/30 19:32:50 Found no layout for "page", language "en", output format "HTML": create a template below /layouts with one of these filenames: articles/single.en.html.html, articles/single.html.html, articles/single.en.html, articles/single.html, _default/single.en.html.html, _default/single.html.html, _default/single.en.html, _default/single.html
WARN 2018/11/30 19:32:50 Found no layout for "page", language "en", output format "HTML": create a template below /layouts with one of these filenames: aws/single.en.html.html, aws/single.html.html, aws/single.en.html, aws/single.html, _default/single.en.html.html, _default/single.html.html, _default/single.en.html, _default/single.html

#2

A cursory look in his theme’s repo shows that there are no single.html templates for the /aws/ and /articles/ sections that you use.

Under the root of your Hugo project you need to create a /layouts/ folder and within that provide the missing templates that are not provided by the theme

The console message is quite specific about the PATH that those templates should have.

If the single pages under both sections should look identical then instead of creating the above two templates, create just one at: /layouts/_default/single.html


#3

Can the files be empty? Because I’m creating those files in the recommended layouts dir with the file names suggested and I’m still getting those warnings.


#4

Use disableKinds to turn off what you do not need:

disableKinds ([])

Enable disabling of all pages of the specified Kinds . Allowed values in this list: "page" , "home" , "section" , "taxonomy" , "taxonomyTerm" , "RSS" , "sitemap" , "robotsTXT" , "404" .

ref: https://gohugo.io/getting-started/configuration/#all-configuration-settings