mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-13 20:24:00 +02:00
Add text transformation template functions.
This commit is contained in:
committed by
spf13
parent
18b9948f1e
commit
0ce6f05f59
@@ -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)
|
||||
|
Reference in New Issue
Block a user