"github.com/spf13/hugo/config"
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
+ "github.com/spf13/hugo/output"
"github.com/spf13/hugo/tpl"
jww "github.com/spf13/jwalterweatherman"
)
Language *helpers.Language
+ // All the output formats available for the current site.
+ OutputFormatsConfig output.Formats
+
templateProvider ResourceProvider
WithTemplate func(templ tpl.TemplateHandler) error `json:"-"`
// 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)
}
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 {
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)
},