From 5517f248c625b291820e22dc2a9372c35ed04bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 6 Mar 2016 14:58:15 +0100 Subject: [PATCH] Add jsonify template func --- content/templates/functions.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/templates/functions.md b/content/templates/functions.md index 146ab8e93..979e603f9 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -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.