mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 18:15:45 +00:00
Add text transformation template functions.
This commit is contained in:
1 parent
18b9948f1e
commit
0ce6f05f59
1 file changed
+3
@@ -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