summaryrefslogtreecommitdiffstats
path: root/tpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-04 14:10:20 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-04 15:12:30 +0200
commit7da1b65968cd78970de8c8b61f5056dc7b0ec6b2 (patch)
tree5c2eaa91db4f603ed74ac0c4575fa2201c789ebf /tpl
parent868f89d5c69c1f028b4d8900ccddd671a8d1922c (diff)
all: Use the configured output types to resolve template type
Closes #320
Diffstat (limited to 'tpl')
-rw-r--r--tpl/tplimpl/template.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/tpl/tplimpl/template.go b/tpl/tplimpl/template.go
index 68528a775..c14d24146 100644
--- a/tpl/tplimpl/template.go
+++ b/tpl/tplimpl/template.go
@@ -276,8 +276,7 @@ func (t *textTemplates) setFuncs(funcMap map[string]interface{}) {
// A prefix can be given to indicate a template namespace to load the templates
// into, i.e. "_internal" etc.
func (t *templateHandler) LoadTemplates(absPath, prefix string) {
- // TODO(bep) output formats. Will have to get to complete list when that is ready.
- t.loadTemplates(absPath, prefix, output.Formats{output.HTMLFormat, output.RSSFormat, output.CalendarFormat, output.AMPFormat, output.JSONFormat})
+ t.loadTemplates(absPath, prefix)
}
@@ -376,7 +375,7 @@ func (t *templateHandler) RebuildClone() {
t.text.clone = texttemplate.Must(t.text.cloneClone.Clone())
}
-func (t *templateHandler) loadTemplates(absPath string, prefix string, formats output.Formats) {
+func (t *templateHandler) loadTemplates(absPath string, prefix string) {
t.Log.DEBUG.Printf("Load templates from path %q prefix %q", absPath, prefix)
walker := func(path string, fi os.FileInfo, err error) error {
if err != nil {
@@ -428,7 +427,7 @@ func (t *templateHandler) loadTemplates(absPath string, prefix string, formats o
RelPath: relPath,
Prefix: prefix,
Theme: t.PathSpec.Theme(),
- OutputFormats: formats,
+ OutputFormats: t.OutputFormatsConfig,
FileExists: func(filename string) (bool, error) {
return helpers.Exists(filename, t.Fs.Source)
},