shithub: hugo

Download patch

ref: 78962a14f86bd6404b467739eb6cc382aecc64c3
parent: ac99ceccac3511f2d4f3c642dfd3b844ba28f900
author: Nicholas Whittier <[email protected]>
date: Thu Jun 26 09:41:29 EDT 2014

Allows 404 templates from themes/THEME directories.

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -738,13 +738,14 @@
 		}
 	}
 
-	if a := s.Tmpl.Lookup("404.html"); a != nil {
-		n.Url = helpers.Urlize("404.html")
-		n.Title = "404 Page not found"
-		n.Permalink = s.permalink("404.html")
+	n.Url = helpers.Urlize("404.html")
+	n.Title = "404 Page not found"
+	n.Permalink = s.permalink("404.html")
 
-		layouts := []string{"404.html"}
-		return s.render(n, "404.html", s.appendThemeTemplates(layouts)...)
+	nfLayouts := []string{"404.html"}
+	nfErr := s.render(n, "404.html", s.appendThemeTemplates(nfLayouts)...)
+	if nfErr != nil {
+		return nfErr
 	}
 
 	return nil