shithub: hugo

Download patch

ref: 4e99d6b54c53e353b111dcaf039364704f751a2c
parent: 640ab3c72e9486ce105091d16c240d413a11a79e
author: spf13 <[email protected]>
date: Wed Jun 4 08:33:16 EDT 2014

Adding proper error message when view is not found.. fixing #303

--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -514,11 +514,17 @@
 func (p *Page) ExecuteTemplate(layout string) *bytes.Buffer {
 	l := p.Layout(layout)
 	buffer := new(bytes.Buffer)
+	worked := false
 	for _, layout := range l {
 		if p.Tmpl.Lookup(layout) != nil {
 			p.Tmpl.ExecuteTemplate(buffer, layout, p)
+			worked = true
 			break
 		}
+	}
+	if !worked {
+		jww.ERROR.Println("Unable to render", layout, ".")
+		jww.ERROR.Println("Expecting to find a template in either the theme/layouts or /layouts in one of the following relative locations", l)
 	}
 	return buffer
 }