output: Rework the base template logic

Extract the logic to a testable function and add support for custom output types.

Fixes #2995
This commit is contained in:
Bjørn Erik Pedersen
2017-03-19 21:09:31 +01:00
parent c7c6b47ba8
commit baa29f6534
8 changed files with 394 additions and 91 deletions

View File

@@ -63,7 +63,9 @@ func pageRenderer(s *Site, pages <-chan *Page, results chan<- error, wg *sync.Wa
var mainPageOutput *PageOutput
for page := range pages {
for i, outFormat := range page.outputFormats {
pageOutput, err := newPageOutput(page, i > 0, outFormat)
if err != nil {