Will have to fix this in a better way later in relation to the non-renderable pages.
But this commit brings the Hugo Benchmark down to "only slightly slower" than master.
```
benchmark old ns/op new ns/op delta
BenchmarkHugo-4
10074504521 10071236251 -0.03%
benchmark old allocs new allocs delta
BenchmarkHugo-4
43623091 49271859 +12.95%
benchmark old bytes new bytes delta
BenchmarkHugo-4
9468322704 9725848376 +2.72%
```
Which is something we can work with.
}
func (p *Page) layouts(layouts ...string) []string {
- // TODO(bep) output
- if len(p.layoutsCalculated) > 0 {
+ // TODO(bep) output the logic here needs to be redone.
+ if len(layouts) == 0 && len(p.layoutsCalculated) > 0 {
return p.layoutsCalculated
}
return p.pageMenus
}
-func (p *Page) Render(layouts ...string) template.HTML {
- l := p.layouts(layouts...)
-
+func (p *Page) Render(layout ...string) template.HTML {
+ l := p.layouts(layout...)
return p.s.Tmpl.ExecuteTemplateToHTML(p, l...)
}