mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-25 11:22:29 +00: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,
|
"relref": RelRef,
|
||||||
"apply": Apply,
|
"apply": Apply,
|
||||||
"chomp": Chomp,
|
"chomp": Chomp,
|
||||||
|
"int": func(v interface{}) int { return cast.ToInt(v) },
|
||||||
|
"string": func(v interface{}) string { return cast.ToString(v) },
|
||||||
"replace": Replace,
|
"replace": Replace,
|
||||||
"trim": Trim,
|
"trim": Trim,
|
||||||
"dateFormat": DateFormat,
|
"dateFormat": DateFormat,
|
||||||
|
|
Loading…
Reference in a new issue