找不到类型“home”的“HTML”布局文件

Dol*_*hin 5 html javascript css hugo

我正在使用此命令在带有 M1 芯片的 MacBook Pro 中运行hugo 项目:

\n
hugo new site example\ncd example\nhugo server\n
Run Code Online (Sandbox Code Playgroud)\n

输出日志如下:

\n
\xe2\x9e\x9c  example hugo server\nStart building sites \xe2\x80\xa6\nhugo v0.92.0+extended darwin/arm64 BuildDate=unknown\nWARN 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.\nWARN 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.\nWARN 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.\n\n                   | EN\n-------------------+-----\n  Pages            |  3\n  Paginator pages  |  0\n  Non-page files   |  0\n  Static files     |  0\n  Processed images |  0\n  Aliases          |  0\n  Sitemaps         |  1\n  Cleaned          |  0\n\nBuilt in 4 ms\nWatching for changes in /example/{archetypes,content,data,layouts,static}\nWatching for config changes in /example/config.toml\nEnvironment: "development"\nServing pages from memory\nRunning in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender\nWeb Server is available at http://localhost:1313/ (bind address 127.0.0.1)\nPress Ctrl+C to stop\nWARN 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.\n
Run Code Online (Sandbox Code Playgroud)\n

当我访问 url http://localhost:1313/ 时,网页是空白的。为什么会发生这种情况?我应该做什么来修复它?至少让它显示默认页面。

\n

小智 1

如果您忽略在 config.toml (DAMHIKT) 中定义主题,您也可能会收到此错误(带有 content/_index.md 和相应的 layouts/index.html)