Closed jmooring closed 5 hours ago
Yea, we could do this (I wish Go generics could help us with this, but I don't think so). Note that should be possible to do:
{{ .Fragments.ToHTML (.Param "toc.startLevel" | int) (.Param "toc.endLevel" | int) true }}
The
Fragments.ToHTML
method onPage
takes three arguments:It would be convenient to pass site and/or page parameters to this method, something like:
The above throws an error with JSON and TOML site/page parameters because the values are unmarshaled to
float64
(JSON) orint64
(TOML). You can work around this with:But it would easier if the method signature were...
... with
cast.ToIntE
, etc.