output: Fix base theme vs project base template logic

Fixes #3323
This commit is contained in:
Bjørn Erik Pedersen
2017-04-12 20:40:36 +02:00
parent efc0e05c4e
commit 077005e514
3 changed files with 63 additions and 38 deletions

View File

@@ -420,13 +420,15 @@ func (t *templateHandler) loadTemplates(absPath string, prefix string) {
li := strings.LastIndex(path, layoutDir) + len(layoutDir) + 1
relPath := path[li:]
templateDir := path[:li-len(layoutDir)-1]
descriptor := output.TemplateLookupDescriptor{
TemplateDir: templateDir,
WorkingDir: workingDir,
LayoutDir: layoutDir,
RelPath: relPath,
Prefix: prefix,
Theme: t.PathSpec.Theme(),
ThemeDir: themeDir,
OutputFormats: t.OutputFormatsConfig,
FileExists: func(filename string) (bool, error) {
return helpers.Exists(filename, t.Fs.Source)