Render 404 in default language only
authorMitchell Cohen <mitch.cohen@me.com>
Sun, 30 Apr 2017 08:40:37 +0000 (04:40 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 30 Apr 2017 08:40:37 +0000 (10:40 +0200)
This prevents 404.html from being re-rendered for each site.

Fixes #3075

hugolib/site_render.go

index a82c93137f795b1cc38eda7a23573234216bd9d1..6aeaf677a6bcf2e59cddae67eae796af6141d75f 100644 (file)
@@ -239,6 +239,10 @@ 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"