mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
hugolib: Fix possible .Content cut
There have been one report of a site with truncated `.Content` after the Hugo `0.40.1` release. This commit fixes this so that race should not be possible anymore. It also adds a stress test with focus on content rendering and multiple output formats. Fixes #4706
This commit is contained in:
@@ -559,14 +559,22 @@ func (h *HugoSites) setupTranslations() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Site) preparePagesForRender(start bool) {
|
||||
func (s *Site) preparePagesForRender(start bool) error {
|
||||
for _, p := range s.Pages {
|
||||
p.setContentInit(start)
|
||||
if err := p.initMainOutputFormat(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, p := range s.headlessPages {
|
||||
p.setContentInit(start)
|
||||
if err := p.initMainOutputFormat(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Pages returns all pages for all sites.
|
||||
|
Reference in New Issue
Block a user