hugo

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

git clone git://git.shimmy1996.com/hugo.git
commit 75ba84acbf8469667cb41efa89b81526a18d6a0a
parent f89eb349e4d6e9044fe54492f63f73317b1d6b0c
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Fri, 15 Jan 2016 23:56:45 +0100

Add int and string cast template funcs

Diffstat:
Mtpl/template_funcs.go | 2++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go
@@ -1507,6 +1507,8 @@ func init() {
 		"relref":       RelRef,
 		"apply":        Apply,
 		"chomp":        Chomp,
+		"int":          func(v interface{}) int { return cast.ToInt(v) },
+		"string":       func(v interface{}) string { return cast.ToString(v) },
 		"replace":      Replace,
 		"trim":         Trim,
 		"dateFormat":   DateFormat,