From: Bjørn Erik Pedersen Date: Thu, 19 Apr 2018 15:40:54 +0000 (+0200) Subject: Revert "hugolib: Prepare child page resources before the page itself" X-Git-Tag: v0.40~15 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d6982ac0acdf0449d74313e2c62d791c55fbaa28;p=brevno-suite%2Fhugo Revert "hugolib: Prepare child page resources before the page itself" This reverts commit 3238e14fdfeedf189a5af122e20bff040ac059bd. --- diff --git a/hugolib/page.go b/hugolib/page.go index 4b7c35d7..d0951bff 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -1069,16 +1069,6 @@ func (p *Page) prepareForRender(cfg *BuildCfg) error { // or a template or similar has changed so wee need to do a rerendering // of the shortcodes etc. - // Handle bundled pages first, so the content is available in the - // owners' shortcodes. - for _, r := range p.Resources.ByType(pageResourceType) { - p.s.PathSpec.ProcessingStats.Incr(&p.s.PathSpec.ProcessingStats.Pages) - bp := r.(*Page) - if err := bp.prepareForRender(cfg); err != nil { - s.Log.ERROR.Printf("Failed to prepare bundled page %q for render: %s", bp.BaseFileName(), err) - } - } - // If in watch mode or if we have multiple output formats, // we need to keep the original so we can // potentially repeat this process on rebuild. @@ -1129,6 +1119,15 @@ func (p *Page) prepareForRender(cfg *BuildCfg) error { //analyze for raw stats p.analyzePage() + // Handle bundled pages. + for _, r := range p.Resources.ByType(pageResourceType) { + p.s.PathSpec.ProcessingStats.Incr(&p.s.PathSpec.ProcessingStats.Pages) + bp := r.(*Page) + if err := bp.prepareForRender(cfg); err != nil { + s.Log.ERROR.Printf("Failed to prepare bundled page %q for render: %s", bp.BaseFileName(), err) + } + } + return nil }