From: Chase Adams Date: Thu, 21 Aug 2014 02:57:51 +0000 (-0700) Subject: Update 404 to be compiled to .html instead of directory X-Git-Tag: v0.12~42 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=348e123;p=brevno-suite%2Fhugo Update 404 to be compiled to .html instead of directory --- diff --git a/hugolib/site.go b/hugolib/site.go index 134b1898..aef7c38f 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -748,6 +748,15 @@ func (s *Site) RenderHomePage() error { } } + // 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")