Improve .Content vs shortcodes

For the content from other pages in shortcodes there are some chicken and
egg dependencies that is hard to get around. But we can improve on this  by preparing the pages in a certain order:

 1. The headless bundles goes first. These are page typically page and image collections..
 2. Leaf bundles
 3. Regular single pages
 4. Branch bundles

Fixes #4632
This commit is contained in:
Bjørn Erik Pedersen
2018-04-19 12:04:34 +02:00
parent 74520d2cfd
commit e590cc26eb
5 changed files with 77 additions and 26 deletions

View File

@@ -1865,14 +1865,15 @@ func getGoMaxProcs() int {
func (s *Site) newNodePage(typ string, sections ...string) *Page {
p := &Page{
language: s.Language,
pageInit: &pageInit{},
Kind: typ,
Source: Source{File: &source.FileInfo{}},
Data: make(map[string]interface{}),
Site: &s.Info,
sections: sections,
s: s}
bundleType: bundleBranch,
language: s.Language,
pageInit: &pageInit{},
Kind: typ,
Source: Source{File: &source.FileInfo{}},
Data: make(map[string]interface{}),
Site: &s.Info,
sections: sections,
s: s}
p.outputFormats = p.s.outputFormats[p.Kind]