shithub: hugo

Download patch

ref: 43891e39947ee30d6667ad4f8154b8c3d93fdd09
parent: 3037d200cb03dd58eaa95e5ded5cf8e319c45f66
author: Bjørn Erik Pedersen <[email protected]>
date: Tue Jul 28 21:19:29 EDT 2015

Always use the template provided in page.Render

Fixes #1306

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -704,13 +704,15 @@
 }
 
 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 {