mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
tpl: Use consistent delimiter spacing in examples
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
75f782a5a7
commit
b8d5c378ba
@@ -32,98 +32,98 @@ func init() {
|
||||
ns.AddMethodMapping(ctx.Add,
|
||||
[]string{"add"},
|
||||
[][2]string{
|
||||
{"{{add 1 2}}", "3"},
|
||||
{"{{ add 1 2 }}", "3"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Ceil,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Ceil 2.1}}", "3"},
|
||||
{"{{ math.Ceil 2.1 }}", "3"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Div,
|
||||
[]string{"div"},
|
||||
[][2]string{
|
||||
{"{{div 6 3}}", "2"},
|
||||
{"{{ div 6 3 }}", "2"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Floor,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Floor 1.9}}", "1"},
|
||||
{"{{ math.Floor 1.9 }}", "1"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Log,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Log 1}}", "0"},
|
||||
{"{{ math.Log 1 }}", "0"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Max,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Max 1 2 }}", "2"},
|
||||
{"{{ math.Max 1 2 }}", "2"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Min,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Min 1 2 }}", "1"},
|
||||
{"{{ math.Min 1 2 }}", "1"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Mod,
|
||||
[]string{"mod"},
|
||||
[][2]string{
|
||||
{"{{mod 15 3}}", "0"},
|
||||
{"{{ mod 15 3 }}", "0"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.ModBool,
|
||||
[]string{"modBool"},
|
||||
[][2]string{
|
||||
{"{{modBool 15 3}}", "true"},
|
||||
{"{{ modBool 15 3 }}", "true"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Mul,
|
||||
[]string{"mul"},
|
||||
[][2]string{
|
||||
{"{{mul 2 3}}", "6"},
|
||||
{"{{ mul 2 3 }}", "6"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Pow,
|
||||
[]string{"pow"},
|
||||
[][2]string{
|
||||
{"{{math.Pow 2 3}}", "8"},
|
||||
{"{{ math.Pow 2 3 }}", "8"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Round,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Round 1.5}}", "2"},
|
||||
{"{{ math.Round 1.5 }}", "2"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Sqrt,
|
||||
nil,
|
||||
[][2]string{
|
||||
{"{{math.Sqrt 81}}", "9"},
|
||||
{"{{ math.Sqrt 81 }}", "9"},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Sub,
|
||||
[]string{"sub"},
|
||||
[][2]string{
|
||||
{"{{sub 3 2}}", "1"},
|
||||
{"{{ sub 3 2 }}", "1"},
|
||||
},
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user