mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Get rid of some viper.Get* calls
Enforce usage of PathSpec Fixes #3060 Updates #2728
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
3d4e99ed50
commit
7e0fa13faa
@@ -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 {
|
||||
|
Reference in New Issue
Block a user