I’m starting out with hugo and just getting the hang of things.
I set up the following templates:
hugo/themes/mytheme/
`- layouts/
`- _default/
`- baseof.html
list.html
single.html
- index.html
When generating my site, only the index.html
is using my _default/baseof.html
template. The _default/list.html
and _default/single.html
just produce empty pages, as if they don’t recognize the _default/baseof.html
template at all.
My _default/baseof.html
contains
{{ block "main" . }}
{{ end }}
And _default/single.html
overwrites this
Hello world from single.html
{{ printf "%#v" . }}
{{ define "main" }}
{{ .Content }}
{{ end }}
The output of a single page is:
Hello world from single.html &hugolib.PageOutput{
Page:(*hugolib.Page)(0xc0424ee500),
paginator:(*hugolib.Pager)(nil),
paginatorInit:sync.Once{
m:sync.Mutex{state:0, sema:0x0}, done:0x0},
resources:resource.Resources(nil),
resourcesInit:sync.Once{m:sync.Mutex{state:0, sema:0x0}, done:0x1},
targetPathDescriptor:hugolib.targetPathDescriptor{
PathSpec:(*helpers.PathSpec)(0xc0426cf830),
Type:output.Format{Name:"HTML",
MediaType:media.Type{MainType:"text", SubType:"html", OldSuffix:"", Delimiter:".",
Suffixes:[]string{"html"}, fileSuffix:""},
Path:"", BaseName:"index", Rel:"canonical", Protocol:"", IsPlainText:false, IsHTML:true,
NoUgly:false, NotAlternative:false}, Kind:"page", Sections:[]string{"userdocs"},
BaseName:"welcome", Dir:"userdocs/", LangPrefix:"en", IsMultihost:false, URL:"",
Addends:"", ExpandedPermalink:"", UglyURLs:false}, outputFormat:output.Format{
Name:"HTML", MediaType:media.Type{MainType:"text", SubType:"html",
OldSuffix:"", Delimiter:".", Suffixes:[]string{"html"}, fileSuffix:""}, Path:"",
BaseName:"index", Rel:"canonical", Protocol:"", IsPlainText:false, IsHTML:true,
NoUgly:false, NotAlternative:false}}
What am I missing here?