I recently imported content from my WordPress page into Hugo. When I run hugo serve
I get following error messages:
WARN 2020/02/17 20:51:06 found no layout file for "HTML" for "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
The page in question starts like this:
---
linktitle: "The Title of the Post"
title: "The Title of the Post"
author: "Franz Drollig"
type: post
date: 2020-01-09T14:41:55+00:00
url: /the-title-of-post/
categories:
- Uncategorized
weight: 10
---
This is the content of the post. This is the second sentence of the post.
It is located in mysite/content/posts/YYYY-MM-DD-title.md
.
The layouts
directory is empty. However, the themes
directory contains the book theme. This theme is also configured in the config.toml
.
Another post, starting like shown below, is rendered correctly.
---
author: "Michael Henderson"
date: 2014-09-28
linktitle: Creating a New Theme
menu:
main:
parent: tutorials
next: /tutorials/github-pages-blog
prev: /tutorials/automated-deployments
title: Creating a New Theme
weight: 10
---
## Introduction
Why is my post not rendered properly? How can I fix it?
type: post
is probably the culprit. Does it need quotes around'post'
? What happens if you remove thepost
front matter altogether? These links may also be helfpul: gohugo.io/content-management/front-matter and gohugo.io/templates/lookup-order – Crucestype: post
solved my problem. If you submit your comment as an answer, I will accept it and you will get the bounty (usually after 2-3 days). – Hower