I am learning Hugo, starting with a single page site without a theme. After reading Homepage Template and Hugo’s Lookup Order, I started with a single layouts/index.html
with a single line as a content
This is the home page
It was a huge success - I saw that line as the output.
Going further, I wanted to add a basic HTML skeleton following the examples in the docs.
I created layouts/_default/baseof.html
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
from baseof.html
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html>
I expect it to always output from baseof.html
and the main
section of a page. I therefore modified layouts/index.html
to
{{ define "main" }}
<main>This is the home page, but better</main>
{{ end }}
I restarted hugo to be sure to start from scratch
PS D:\Nextcloud\dev-perso\blog> hugo server --disableFastRender
Start building sites …
hugo v0.98.0-165d299cde259c8b801abadc6d3405a229e449f6 windows/amd64 BuildDate=2022-04-28T10:23:30Z VendorInfo=gohugoio
WARN 2022/05/01 23:07:11 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/05/01 23:07:11 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 10 ms
Watching for changes in D:\Nextcloud\dev-perso\blog\{archetypes,content,data,layouts,static}
Watching for config changes in D:\Nextcloud\dev-perso\blog\config.toml
Environment: "development"
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
and now I get a blank page
It looks like layouts/_default/baseof.html
is not applied at all (not even the straight from baseof.html
string, not to mention any content).
What did I do wrong?