Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/math/init.go')
-rw-r--r--tpl/math/init.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/tpl/math/init.go b/tpl/math/init.go
index ddbd2fc73..4d8a23fde 100644
--- a/tpl/math/init.go
+++ b/tpl/math/init.go
@@ -64,10 +64,17 @@ func init() {
},
)
- ns.AddMethodMapping(ctx.Sqrt,
+ ns.AddMethodMapping(ctx.Max,
nil,
[][2]string{
- {"{{math.Sqrt 81}}", "9"},
+ {"{{math.Max 1 2 }}", "2"},
+ },
+ )
+
+ ns.AddMethodMapping(ctx.Min,
+ nil,
+ [][2]string{
+ {"{{math.Min 1 2 }}", "1"},
},
)
@@ -106,6 +113,13 @@ func init() {
},
)
+ ns.AddMethodMapping(ctx.Sqrt,
+ nil,
+ [][2]string{
+ {"{{math.Sqrt 81}}", "9"},
+ },
+ )
+
ns.AddMethodMapping(ctx.Sub,
[]string{"sub"},
[][2]string{