output: Add output formats decoder

And clean up the output package.
This commit is contained in:
Bjørn Erik Pedersen
2017-04-03 17:00:23 +02:00
parent d6e8b86f66
commit c9aee467d3
6 changed files with 281 additions and 91 deletions

View File

@@ -909,7 +909,7 @@ func (p *Page) update(f interface{}) error {
o := cast.ToStringSlice(v)
if len(o) > 0 {
// Output formats are exlicitly set in front matter, use those.
outFormats, err := output.GetFormats(o...)
outFormats, err := output.DefaultFormats.GetByNames(o...)
if err != nil {
p.s.Log.ERROR.Printf("Failed to resolve output formats: %s", err)