I am trying to build a simple Hugo project. The problem is that I am trying to create some basic layouts and I get an error when rendering.
Inside the /layouts/_default I have the following:
baseof.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }} | {{ .Title }}>
</head>
<body>
<header>
<p>this is a header</p>
</header>
<main>
{{ block "main" . }}
{{ end }}
</main>
<footer>
<p>this is a footer</p>
</footer>
</body>
</html>
list.html
{{ define "main" }}
<h2>List</h2>
{{.Content}}
<!-- prettier-ignore -->
{{ range .Pages }}
<div>
<a href="{{.Permalink}}">{{.Title}}</a>
<p>{{ dateFormat "Monday, Jan 2, 2006" .Date }}</p>
</div>
{{ end }}
<!-- prettier-ignore -->
{{ end }}
single.html
{{ define "main" }}
<h1>{{ .Title }}</h1>
<h2>{{ .PublishDate }}</h2>
{{ .Content }}
<!-- prettier-ignore -->
{{ end }}
When I try running, I get the following error (same error both for single.html and for list.html):
2020/09/12 20:33:30 Failed to render pages: render of "page" failed: execute of template failed: html/template:_default/single.html: ends in a non-text context: {stateRCDATA delimNone urlPartNone jsCtxRegexp attrNone elementTitle }
Can you give me any suggestions?