aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_render.go
diff options
context:
space:
mode:
authorMitchell Cohen <[email protected]>2017-07-01 16:58:52 -0400
committerBjørn Erik Pedersen <[email protected]>2017-07-01 22:58:52 +0200
commit41805dca9e40e9b0952e04d06074e6fc91140495 (patch)
tree1d0fc01c0f7a73e0bf1659b33b2fdacf2df00982 /hugolib/site_render.go
parent7ee1f25e9ef3be8f99c171e8e7982f4f82c13e16 (diff)
downloadhugo-41805dca9e40e9b0952e04d06074e6fc91140495.tar.gz
hugo-41805dca9e40e9b0952e04d06074e6fc91140495.zip
hugolib: Render 404.html for all languages
Fixes #3598
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r--hugolib/site_render.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
index a24946cf3..42433a70a 100644
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -239,10 +239,6 @@ func (s *Site) render404() error {
return nil
}
- if s.owner.multilingual.enabled() && (s.Language.Lang != s.owner.multilingual.DefaultLang.Lang) {
- return nil
- }
-
p := s.newNodePage(kind404)
p.Title = "404 Page not found"
@@ -256,13 +252,20 @@ func (s *Site) render404() error {
nfLayouts := []string{"404.html"}
- pageOutput, err := newPageOutput(p, false, output.HTMLFormat)
+ htmlOut := output.HTMLFormat
+ htmlOut.BaseName = "404"
+
+ pageOutput, err := newPageOutput(p, false, htmlOut)
if err != nil {
return err
}
- return s.renderAndWritePage("404 page", "404.html", pageOutput, s.appendThemeTemplates(nfLayouts)...)
+ targetPath, err := pageOutput.targetPath()
+ if err != nil {
+ s.Log.ERROR.Printf("Failed to create target path for page %q: %s", p, err)
+ }
+ return s.renderAndWritePage("404 page", targetPath, pageOutput, s.appendThemeTemplates(nfLayouts)...)
}
func (s *Site) renderSitemap() error {