back

by dochtman·4y ago·view on hn ↗
> Sadly, there isn't any great alternative for making performant HTML templates in Rust from what I've seen, a lot of the other HTML templating libs aren't that great comparatively.

Which others have you tried, and why do you think they're not great?

1 comments
I've tried handlebars and liquid. They're okayish, but both slow and don't have any compiletime help or typing when I tried them.

Horroshow, ructe, typed-html and yarte were okay but inheritance was underdocumented (or generally not as well documented), which is a big no for me. And a few only give minor-quality help at compile time.

Maud on the other hand has decent compiletime help and doesn't require a lot of documentation as normal rust code is doing the heavy lifting.

I created Askama (which yarte forked), the inheritance docs aren't great but also not too bad. Curious why you didn't try it?
I haven't found askama yet, or rather, discovered it through HN here, I don't check the arewewebyet.org site too often and it's my main source of frameworks to find.

My main worry on things is that I'd rather like being able to express the inheritance in the type system through generics. Ie, having a top level "Page<T>" struct in which I can start putting the various subparts needed to render a page. It seems askama is doing it the other way round with a "parent" member needed in the child page.