hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 0ce6f05f59213c460ec451020899afba35f67bd0
parent 18b9948f1effa94a16c70dd312c56a9835ffa038
Author: Vincent Batoufflet <vincent@batoufflet.info>
Date:   Sun, 26 Jan 2014 10:28:35 +0100

Add text transformation template functions.

Diffstat:
Mtemplate/bundle/template.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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)