How to fix the error `found no layout file for "HTML" for "page"` in Hugo CMS? How to fix the error `found no layout file for "HTML" for "page"` in Hugo CMS? wordpress wordpress

How to fix the error `found no layout file for "HTML" for "page"` in Hugo CMS?


FIX:

Okay so here is what is likely happening:

You have a theme you added as a git submodule and you recently re-cloned your project. Guess what? Your submodule needs to be re-downloaded as well.

You can do this with:

  • git submodule init
  • git submodule update

Then your project will load without errors.


I don't have experience with Hugo, but figure I'd comment if it helps to point you in the right direction.

The front matter seems very different between those two documents. I'm thinking the type: post is probably the culprit.

What happens if you remove the post front matter altogether?

These links may also be helfpul:
Front Matter | Hugo
Hugo's Lookup Order | Hugo


You have to create the layouts needed; by default the layout of page is named single.html, and the layout of section is named list.html.

Even if you would not use those as a real template, you have to create it in order to avoid that WARN.

So, create those files inside layout/_default: single.html list.html. Also, if you feel applied write some comment with a hugo template inside each file like this:

{{ "<!-- Layout with no content to avoid WARN message about missing page layout -->" | safeHTML }}