router_static.go: use different template delims

Vue.js uses the same template system {{variable}}, and that clashes
with Go's default delimiters for templates.
This commit is contained in:
Adhityaa 2018-06-03 14:03:45 +05:30
parent 72ab137f06
commit e0f9679694

View File

@ -45,7 +45,7 @@ func initStaticRouter(router *mux.Router) error {
return err return err
} }
t, err := template.New(page).Parse(string(contents)) t, err := template.New(page).Delims("<<<", ">>>").Parse(string(contents))
if err != nil { if err != nil {
logger.Errorf("cannot parse %s.html template: %v", page, err) logger.Errorf("cannot parse %s.html template: %v", page, err)
return err return err