Always use the template provided in page.Render
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 28 Jul 2015 23:19:29 +0000 (01:19 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 28 Jul 2015 23:19:29 +0000 (01:19 +0200)
Fixes #1306

hugolib/page.go

index 9b18f1430cf5897e6f4c56599d708aa893adb565..b139bbb79a1be2f10b552653ade746500dc75687 100644 (file)
@@ -704,13 +704,15 @@ func (p *Page) Menus() PageMenus {
 }
 
 func (p *Page) Render(layout ...string) template.HTML {
-       curLayout := ""
+       var l []string
 
        if len(layout) > 0 {
-               curLayout = layout[0]
+               l = layouts(p.Type(), layout[0])
+       } else {
+               l = p.Layout()
        }
 
-       return tpl.ExecuteTemplateToHTML(p, p.Layout(curLayout)...)
+       return tpl.ExecuteTemplateToHTML(p, l...)
 }
 
 func (p *Page) guessMarkupType() string {