hugolib: Don't write zero-bytes files to disk

Fixes #2709
This commit is contained in:
Bjørn Erik Pedersen 2016-11-20 14:59:21 +01:00
parent 65f803e1fa
commit 3b42640e3f

View file

@ -2417,15 +2417,16 @@ Your rendered home page is blank: /index.html is zero-length
debugAddend) debugAddend)
} }
} // Avoid writing empty files to disk.
return nil
if err == nil { }
if err = s.writeDestPage(dest, pageTarget, outBuffer); err != nil { if err = s.writeDestPage(dest, pageTarget, outBuffer); err != nil {
return err return err
} }
}
return err return nil
} }
func (s *Site) renderForLayouts(name string, d interface{}, w io.Writer, layouts ...string) error { func (s *Site) renderForLayouts(name string, d interface{}, w io.Writer, layouts ...string) error {