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

@@ -94,3 +94,18 @@ func NewPathSpec(fs *hugofs.Fs, cfg config.Provider) *PathSpec {
func (p *PathSpec) PaginatePath() string {
return p.paginatePath
}
// WorkingDir returns the configured workingDir.
func (p *PathSpec) WorkingDir() string {
return p.workingDir
}
// LayoutDir returns the relative layout dir in the currenct Hugo project.
func (p *PathSpec) LayoutDir() string {
return p.layoutDir
}
// Theme returns the theme name if set.
func (p *PathSpec) Theme() string {
return p.theme
}