Fix one bug

pull/211/head
Henrique Dias 2017-08-20 10:23:04 +01:00
parent 154bfb19d5
commit 70751c48d2
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730
1 changed files with 8 additions and 4 deletions

View File

@ -224,10 +224,14 @@ func renderFile(c *fm.Context, w http.ResponseWriter, file string, contentType s
tpl := template.Must(template.New("file").Parse(file))
w.Header().Set("Content-Type", contentType+"; charset=utf-8")
err := tpl.Execute(w, map[string]interface{}{
"BaseURL": c.RootURL(),
"StaticGen": c.StaticGen.Name(),
})
data := map[string]interface{}{"BaseURL": c.RootURL()}
if c.StaticGen != nil {
data["StaticGen"] = c.StaticGen.Name()
}
err := tpl.Execute(w, data)
if err != nil {
return http.StatusInternalServerError, err
}