mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Add text transformation template functions.
This commit is contained in:
parent
18b9948f1e
commit
0ce6f05f59
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue