found no layout file for "HTML" for kind "home"
Asked Answered
R

3

6

I am using this command to run a hugo project in my MacBook Pro with M1 chip:

hugo new site example
cd example
hugo server

the output log like this:

➜  example hugo server
Start building sites …
hugo v0.92.0+extended darwin/arm64 BuildDate=unknown
WARN 2022/03/27 15:49:33 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 2022/03/27 15:49:33 found no layout file for "HTML" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2022/03/27 15:49:33 found no layout file for "HTML" for kind "taxonomy": 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

Built in 4 ms
Watching for changes in /example/{archetypes,content,data,layouts,static}
Watching for config changes in /example/config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
WARN 2022/03/27 15:49:36 found no layout file for "HTML" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

when I access the url http://localhost:1313/, the web page was blank. why did this happen? what should I do to fix it? At least make it show the default page.

Romonaromonda answered 27/3, 2022 at 7:55 Comment(2)
You should make a homepage... _index.md and a layout for it: index.html (and probably baseof.html, etc. etc. etc.) : gohugo.io/getting-started/quick-startSeparates
The warning only tells you that you should create 'a layout' for home, not the homepage. List pages can be omitted. I am not sure if the same is the case for the homepage (or if you already created such a page).Tame
P
1

You can also get this error (WITH a content/_index.md and corresponding layouts/index.html) if you neglect to define your theme in the config.toml (DAMHIKT)

Precambrian answered 19/5, 2022 at 0:3 Comment(1)
@SumitSharma I respectfully disagree with you. The situation addressed here is the error in the title: found no layout file for "HTML" for kind "home".Tame
H
1

I had the same issue and solved it by upgrading my version of hugo with brew update; brew upgrade hugo (Hugo Update Instructions). Then try following the quick start guide again.

You can check your version of hugo with hugo version (my version is now hugo v0.115.1). The quickstart instructions currently state you must have version v0.112.0 or later (Hugo Quick Start Guide).

Hypodermis answered 8/7, 2023 at 11:12 Comment(1)
I updated golang, hugo, and the git submodule for the theme I was using for my site. Then the error went awayPresa
N
-2

To anyone getting this error while trying to give Hugo a quick whirl: the binary package from your distro might be out of date (mine was v0.88, we're currently at 0.113).

Try using the Go toolchain (i.e. "build from source") :

go install github.com/gohugoio/hugo@latest

or, if you want the "extended edition":

CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest

Now if you didn't have the Go toolchain installed already, forget about that blog you were about to write, and consider learning Go instead. The world probably doesn't need another blog anyway, but it might need a few more coders :-J.

Numerology answered 9/6, 2023 at 11:5 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.