Use helpers.GetThemeDir() to find base templates.

Now that we have the helpers.GetThemeDir() function, use it instead of
calling directly into viper.
This commit is contained in:
Jonathan Anderson 2015-06-19 11:00:34 -02:30 committed by Bjørn Erik Pedersen
parent 1058cb17d1
commit c4ad8f6498

View file

@ -21,7 +21,6 @@ import (
"github.com/spf13/hugo/helpers" "github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs" "github.com/spf13/hugo/hugofs"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
"github.com/yosssi/ace" "github.com/yosssi/ace"
"html/template" "html/template"
"io" "io"
@ -306,8 +305,7 @@ func (t *GoHTMLTemplate) loadTemplates(absPath string, prefix string) {
currBaseAceFilename := fmt.Sprintf("%s-%s", helpers.Filename(path), baseAceFilename) currBaseAceFilename := fmt.Sprintf("%s-%s", helpers.Filename(path), baseAceFilename)
templateDir := filepath.Dir(path) templateDir := filepath.Dir(path)
themeDir := filepath.Join( themeDir := helpers.GetThemeDir()
viper.GetString("WorkingDir"), "themes", viper.GetString("theme"))
pathsToCheck := []string{ pathsToCheck := []string{
filepath.Join(templateDir, currBaseAceFilename), filepath.Join(templateDir, currBaseAceFilename),