From 0ce6f05f59213c460ec451020899afba35f67bd0 Mon Sep 17 00:00:00 2001 From: Vincent Batoufflet Date: Sun, 26 Jan 2014 10:28:35 +0100 Subject: [PATCH] Add text transformation template functions. --- template/bundle/template.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/bundle/template.go b/template/bundle/template.go index 1984d0f28..fd0df6936 100644 --- a/template/bundle/template.go +++ b/template/bundle/template.go @@ -170,6 +170,9 @@ func NewTemplate() Template { "mod": func(a, b int) int { return a % b }, "mul": func(a, b int) int { return a * b }, "modBool": func(a, b int) bool { return a%b == 0 }, + "lower": func(a string) string { return strings.ToLower(a) }, + "upper": func(a string) string { return strings.ToUpper(a) }, + "title": func(a string) string { return strings.Title(a) }, } templates.Funcs(funcMap)