Skip to content

Commit

Permalink
Update 404 to be compiled to .html instead of directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase Adams authored and spf13 committed Aug 25, 2014
1 parent 50a8c50 commit 348e123
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hugolib/site.go
Expand Up @@ -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")
Expand Down

0 comments on commit 348e123

Please sign in to comment.