shithub: hugo

Download patch

ref: 348e123c9fda4dc2b604b671653ee36035f141aa
parent: 50a8c50726c4fc042fa4df4e10b8ba69860cc1d5
author: Chase Adams <chase@realchaseadams.com>
date: Wed Aug 20 15:57:51 EDT 2014

Update 404 to be compiled to .html instead of directory

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -748,6 +748,15 @@
 		}
 	}
 
+	// Force `UglyUrls` option to force `404.html` file name
+	switch s.Target.(type) {
+	case *target.Filesystem:
+		if !s.Target.(*target.Filesystem).UglyUrls {
+			s.Target.(*target.Filesystem).UglyUrls = true
+			defer func() { s.Target.(*target.Filesystem).UglyUrls = false }()
+		}
+	}
+
 	n.Url = helpers.Urlize("404.html")
 	n.Title = "404 Page not found"
 	n.Permalink = s.permalink("404.html")
--