node to page: Create pages for nodes without content

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-01 22:39:24 +01:00
parent f8bda16e15
commit 75c38071d8
6 changed files with 297 additions and 51 deletions

View File

@@ -1606,8 +1606,12 @@ func (s *Site) nodeTypeFromSections(sections []string) NodeType {
}
func (s *Site) findPagesByNodeType(n NodeType) Pages {
return s.findPagesByNodeTypeIn(n, s.Pages)
}
func (s *Site) findPagesByNodeTypeIn(n NodeType, inPages Pages) Pages {
var pages Pages
for _, p := range s.Pages {
for _, p := range inPages {
if p.NodeType == n {
pages = append(pages, p)
}
@@ -1615,6 +1619,14 @@ func (s *Site) findPagesByNodeType(n NodeType) Pages {
return pages
}
func (s *Site) findAllPagesByNodeType(n NodeType) Pages {
return s.findPagesByNodeTypeIn(n, s.rawAllPages)
}
func (s *Site) findRawAllPagesByNodeType(n NodeType) Pages {
return s.findPagesByNodeTypeIn(n, s.rawAllPages)
}
// renderAliases renders shell pages that simply have a redirect in the header.
func (s *Site) renderAliases() error {
for _, p := range s.Pages {