WARN found no layout file for "html" for kind "home" - when running with loglevel debug

Hi, I learned Hugo from a book to make a personal website and facing this peculiar issue. Here’s the stripped down idea.

My site currently consists only of the homepage. I am not using any themes or content types, _index.md (the root branch bundle’s homepage) does not mention either “type” or “layout” in its front-matter, neither does my config file where I also disabled taxonomies entirely.

disableKinds:
-terms
-taxonomies

In my layouts folder, I have just the one folder called “_default”. This contains

  • baseof.html
  • index.html

Now, my site / landing page works perfectly! Even if I locally run with -loglevel info, I don’t get this warning. But, if I run with the verbosity “debug”, I get

WARN 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 found no layout file for “html” for kind “section”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

This is even if I have the list.html and single.html in layouts/_default folder (which are picked up successfully by the pages without any type/layout specified). If I define another single page (not a leaf/branch), I get warned for the “post” kind as well.

Seems either like some oversight, or I’m missing something minor, but this is just triggering my OCD. Even in the lookup order, the first file seems to be layouts/index.html, which I had originally (before I moved it to the _default subfolder), and still got these warnings.

I used Netlify originally for deploying it, but I disabled it a long time ago, so that is not a concern here presumably. Here’s my hugo env log:

hugo v0.136.5-46cccb021bc6425455f4eec093f5cc4a32f1d12c+extended windows/amd64 BuildDate=2024-10-24T12:26:27Z VendorInfo=gohugoio
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.23.2"
github.com/sass/libsass="3.6.6"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass/protocol="2.7.1"
github.com/sass/dart-sass/compiler="1.77.5"
github.com/sass/dart-sass/implementation="1.77.5"

I don’t know how to provide a repo easily with a bunch of personal information, so avoiding it for the moment. Please do let me know if there’s anything specific I could provide. Apologies if I missed anything from the prereqs. Thank you so much for taking the time! :slight_smile:

Sid

I am unable to reproduce the problem as described. Try it:

git clone --single-branch -b hugo-forum-topic-52120 https://github.com/jmooring/hugo-testing hugo-forum-topic-52120
cd hugo-forum-topic-52120
hugo --logLevel debug
1 Like

Thank you so much! :slight_smile: I tried cloning, ran the comment, and got the same warning again. I uploaded a screenshot this time. Please let me know if there’s anything else I could provide.

Edit- to clarify, I got the “section” warning when I created a branch bundle folder. When I deleted it, the “section” warning went away (also if I disabled “sections” in the disableKinds field).

Your command line flag is wrong. Both should be prefixed with two hyphens, not just one. Type hugo help server.

With just a single hyphen, -lfoo is the same thing as --layoutDir foo, which doesn’t exist, so there are zero layouts.

Okay, I feel like ending myself. For some reason, I was trying -loglevel (with one hyphen as you mentioned), but also notice the non-caps “l” in “level”. But why didn’t that complain I wonder?

When I tried hugo server --logLevel debug in my clone of your test, I didn’t get that warning. Please hold as I try it on mine.

Because -loglevel debug is equivalent to --layoutDir oglevel debug. With many apps, including Hugo, a space is not required between a single hyphen command line flag and the corresponding value (if any). A good example of this is grep.

hugo config | grep -A5 "frontmatter"

You don’t need a space between -A and 5 (the number of lines).

1 Like

Okay! I just tried it! It works perfectly! The warnings are gone. I’m still a bit stumped as to what was happening. (Oh, you elaborated on it as I was typing).

I still don’t fully get this, but atleast thanks to you I know what’s going on and my head will finally stop spinning.

This was so weird, and no way I’d have figured this out without your help, I tried just about everything with placing different layout files in different folders. I’d never have known where to look. Thank you SO MUCH! :)))

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.