mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 08:23:48 +02:00
17 lines
371 B
Go
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)
|
|
}
|