Questions about .RenderString

If you add options to the mix, I think it’s easier to reason about if you use the pipe syntax, e.g.

{{ .Text | $.Page.RenderString $options }}

And for people asking “why complicate stuff by needing the page context”, the answer is that the render hooks are very much tied to a Page (template lookups, the page context sent into the hooks etc.), so a stateless function will not work (as well).

1 Like