Add jsonify template func

This commit is contained in:
Bjørn Erik Pedersen
2016-03-06 14:58:15 +01:00
parent c8c6f5d05b
commit 435e996c4f
3 changed files with 21 additions and 0 deletions

View File

@@ -112,6 +112,14 @@ e.g.
{{ .Render "summary" }}
{{ end }}
### jsonify
Encodes a given object to JSON.
e.g.
{{ dict "title" .Title "content" .Plain | jsonify }}
### last
Slices an array to only the last _N_ elements.