mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 20:17:17 +00:00
Add int and string cast template funcs
This commit is contained in:
1 parent
f89eb349e4
commit
75ba84acbf
1 file changed
+2
@@ -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,
|
||||||
|
|||||||
Reference in new issue
Block a user