diff options
Diffstat (limited to 'internal/router/template.go')
-rw-r--r-- | internal/router/template.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/router/template.go b/internal/router/template.go index bf5682628..b0d998208 100644 --- a/internal/router/template.go +++ b/internal/router/template.go @@ -26,18 +26,20 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/spf13/viper" "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/config" ) // loadTemplates loads html templates for use by the given engine -func loadTemplates(cfg *config.Config, engine *gin.Engine) error { +func loadTemplates(engine *gin.Engine) error { cwd, err := os.Getwd() if err != nil { return fmt.Errorf("error getting current working directory: %s", err) } - tmPath := filepath.Join(cwd, fmt.Sprintf("%s*", cfg.TemplateConfig.BaseDir)) + templateBaseDir := viper.GetString(config.Keys.WebTemplateBaseDir) + tmPath := filepath.Join(cwd, fmt.Sprintf("%s*", templateBaseDir)) engine.LoadHTMLGlob(tmPath) return nil |