mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
hugolib: Fix handling of zero-length files
This was a regression in Hugo 0.20. This commit makes sure that zeron-length files are not rendered to file. Fixes #3355
This commit is contained in:
parent
e98f885b8a
commit
0e87b18b66
4 changed files with 28 additions and 0 deletions
|
@ -340,6 +340,10 @@ func (s *Site) renderRobotsTXT() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
if outBuffer.Len() == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return s.publish("robots.txt", outBuffer)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue