Keats/tera

Template fragments

Closed this issue · 1 comments

Hi !

I were wondering what you think of having the possibility to only render a block of a template ? (it might already be possible but i didn't see anything like this in the doc)

Like tera.render_block("cool.html", "cool_block", &context)?;

It would be really great in addition of HTMX to allow sending back only a part of the page :)

Have a nice day :)

I was thinking of adding that but mostly for macros. To render a block, you will still need to render the whole template and then extract the given block. I'll probably add something like that to tera2