mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
hugolib: Fix bundle resource publishing when multiple output formats
The faulty logic published the bundled resources for the "first output" format. This worked most of the time, but since the output formats list is sorted, any output format only used for some of the pages (e.g. CSS) would not work properly. Fixes #5858
This commit is contained in:
parent
b799b12f4a
commit
49d0a82641
5 changed files with 83 additions and 41 deletions
|
@ -35,6 +35,7 @@ type siteRenderContext struct {
|
|||
sitesOutIdx int
|
||||
|
||||
// Zero based index of the output formats configured within a Site.
|
||||
// Note that these outputs are sorted, so CSS will come before HTML.
|
||||
outIdx int
|
||||
|
||||
multihost bool
|
||||
|
@ -130,11 +131,9 @@ func pageRenderer(
|
|||
continue
|
||||
}
|
||||
|
||||
if ctx.outIdx == 0 {
|
||||
if err := p.renderResources(); err != nil {
|
||||
s.SendError(p.errorf(err, "failed to render page resources"))
|
||||
continue
|
||||
}
|
||||
if err := p.renderResources(); err != nil {
|
||||
s.SendError(p.errorf(err, "failed to render page resources"))
|
||||
continue
|
||||
}
|
||||
|
||||
layouts, err := p.getLayouts()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue