mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Add int and string cast template funcs
This commit is contained in:
parent
f89eb349e4
commit
75ba84acbf
1 changed files with 2 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue