node to page: Fix the page collections

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-04 00:34:25 +01:00
parent c175407fa4
commit 698b994f71
8 changed files with 206 additions and 106 deletions

View File

@@ -1260,12 +1260,12 @@ func (p *Page) prepareLayouts() error {
// TODO(bep) np naming, move some
func (p *Page) prepareData(s *Site) error {
p.Data = make(map[string]interface{})
switch p.NodeType {
case NodePage:
case NodeHome:
// TODO(bep) np cache the below
p.Data["Pages"] = s.owner.findAllPagesByNodeType(NodePage)
p.Data["Pages"] = s.Pages
case NodeSection:
sectionData, ok := s.Sections[p.sections[0]]
if !ok {