Refactor layout resolve to a descriptor/adapter pattern

This commit is contained in:
Bjørn Erik Pedersen
2017-03-16 08:58:50 +01:00
parent 4c2abe0015
commit ad8cea87f3
5 changed files with 44 additions and 84 deletions

View File

@@ -1661,7 +1661,7 @@ func (s *Site) kindFromSections(sections []string) string {
}
func (s *Site) layouts(p *PageOutput) []string {
return s.layoutHandler.For(p.layoutIdentifier, "", p.outputFormat)
return s.layoutHandler.For(p.createLayoutDescriptor(), "", p.outputFormat)
}
func (s *Site) preparePages() error {
@@ -2062,7 +2062,6 @@ func (s *Site) newNodePage(typ string) *Page {
Site: &s.Info,
s: s}
p.outputFormats = p.s.defaultOutputDefinitions.ForKind(typ)
p.layoutIdentifier = pageLayoutIdentifier{p}
return p
}