Hacker News new | ask | show | jobs
by leg100 249 days ago
Did you use templ [1] for server side templating? It supports something called fragments, which may help with HTMX [2].

[1]: https://templ.guide/

[2]: https://templ.guide/syntax-and-usage/fragments

1 comments

The standard library html/template also has that in the form of blocks.
html/template blocks are not as ergonomic. They force you to work on the template level and drill down into the blocks. Templ, Gomponents etc. let you build up the components from smaller pieces, like Lego.