hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 43891e39947ee30d6667ad4f8154b8c3d93fdd09
parent 3037d200cb03dd58eaa95e5ded5cf8e319c45f66
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Wed, 29 Jul 2015 01:19:29 +0200

Always use the template provided in page.Render

Fixes #1306

Diffstat:
Mhugolib/page.go | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hugolib/page.go b/hugolib/page.go
@@ -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 {