shithub: hugo

Download patch

ref: c4ad8f6498ea5b629b68a39f2e9877313c17f4d3
parent: 1058cb17d14ea404838e759ebe028e3ad992668a
author: Jonathan Anderson <[email protected]>
date: Fri Jun 19 07:00:34 EDT 2015

Use helpers.GetThemeDir() to find base templates.

Now that we have the helpers.GetThemeDir() function, use it instead of
calling directly into viper.

--- a/tpl/template.go
+++ b/tpl/template.go
@@ -21,7 +21,6 @@
 	"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"
@@ -306,8 +305,7 @@
 
 					currBaseAceFilename := fmt.Sprintf("%s-%s", helpers.Filename(path), baseAceFilename)
 					templateDir := filepath.Dir(path)
-					themeDir := filepath.Join(
-						viper.GetString("WorkingDir"), "themes", viper.GetString("theme"))
+					themeDir := helpers.GetThemeDir()
 
 					pathsToCheck := []string{
 						filepath.Join(templateDir, currBaseAceFilename),