2. <current-path>/baseof.ace
3. _default/<template-name>-baseof.ace, e.g. list-baseof.ace.
4. _default/baseof.ace
+5. <themedir>/layouts/_default/<template-name>-baseof.ace
+6. <themedir>/layouts/_default/baseof.ace
```
In the above, `current-path` is where the corresponding inner template lives, `list.ace`, `single.ace`, `index.ace` ...
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
jww "github.com/spf13/jwalterweatherman"
+ "github.com/spf13/viper"
"github.com/yosssi/ace"
"html/template"
"io"
// 2. <current-path>/baseof.ace
// 3. _default/<template-name>-baseof.ace, e.g. list-baseof.ace.
// 4. _default/baseof.ace
+ // 5. <themedir>/layouts/_default/<template-name>-baseof.ace
+ // 6. <themedir>/layouts/_default/baseof.ace
currBaseAceFilename := fmt.Sprintf("%s-%s", helpers.Filename(path), baseAceFilename)
templateDir := filepath.Dir(path)
+ themeDir := filepath.Join(
+ viper.GetString("WorkingDir"), "themes", viper.GetString("theme"))
pathsToCheck := []string{
filepath.Join(templateDir, currBaseAceFilename),
filepath.Join(templateDir, baseAceFilename),
filepath.Join(absPath, "_default", currBaseAceFilename),
- filepath.Join(absPath, "_default", baseAceFilename)}
+ filepath.Join(absPath, "_default", baseAceFilename),
+ filepath.Join(themeDir, "layouts", "_default", currBaseAceFilename),
+ filepath.Join(themeDir, "layouts", "_default", baseAceFilename),
+ }
for _, pathToCheck := range pathsToCheck {
if ok, err := helpers.Exists(pathToCheck, hugofs.OsFs); err == nil && ok {