Get rid of some viper.Get* calls

Enforce usage of PathSpec

Fixes #3060
Updates #2728
This commit is contained in:
bogem
2017-02-20 03:53:48 +05:00
committed by Bjørn Erik Pedersen
parent 3d4e99ed50
commit 7e0fa13faa
3 changed files with 25 additions and 40 deletions

View File

@@ -95,7 +95,7 @@ func applyDepsIfNeeded(cfg deps.DepsCfg, sites ...*Site) error {
d = deps.New(cfg)
s.Deps = d
if err := d.LoadResources(); err != nil {
if err = d.LoadResources(); err != nil {
return err
}
@@ -123,9 +123,9 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) {
func (s *Site) withSiteTemplates(withTemplates ...func(templ tpl.Template) error) func(templ tpl.Template) error {
return func(templ tpl.Template) error {
templ.LoadTemplates(s.absLayoutDir())
if s.hasTheme() {
templ.LoadTemplatesWithPrefix(s.absThemeDir()+"/layouts", "theme")
templ.LoadTemplates(s.PathSpec.GetLayoutDirPath())
if s.PathSpec.ThemeSet() {
templ.LoadTemplatesWithPrefix(s.PathSpec.GetThemeDir()+"/layouts", "theme")
}
for _, wt := range withTemplates {