diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-19 21:09:31 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-27 15:43:56 +0200 |
commit | baa29f6534fcd324dbade7dd6c32c90547e3fa4f (patch) | |
tree | 71a7524c25365cfc4a7cc1bbaab9d63988525d5e /hugolib/page.go | |
parent | c7c6b47ba8bb098cf9fac778f7818afba40a1e2f (diff) |
output: Rework the base template logic
Extract the logic to a testable function and add support for custom output types.
Fixes #2995
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index f477e6a14..390df8070 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -923,10 +923,11 @@ func (p *Page) update(f interface{}) error { p.s.Log.ERROR.Printf("Failed to parse lastmod '%v' in page %s", v, p.File.Path()) } case "outputs": - outputs := cast.ToStringSlice(v) - if len(outputs) > 0 { + o := cast.ToStringSlice(v) + if len(o) > 0 { // Output formats are exlicitly set in front matter, use those. - outFormats, err := output.GetTypes(outputs...) + outFormats, err := output.GetFormats(o...) + if err != nil { p.s.Log.ERROR.Printf("Failed to resolve output formats: %s", err) } else { |