1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-12 08:23:48 +02:00
woodpecker/server/template/template.go
2017-05-12 16:06:01 +02:00

17 lines
371 B
Go

package template
//go:generate togo tmpl -package template -func funcMap -format html -input files/*.html
import (
"encoding/json"
"html/template"
)
var funcMap = template.FuncMap{"json": marshal}
// marshal is a helper function to render data as JSON inside the template.
func marshal(v interface{}) template.JS {
a, _ := json.Marshal(v)
return template.JS(a)
}