Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IDK. I always though Jinja is the best templating engine and was surprised by your complaints and the Jinja sample on that website. What doesn't he like? Looks totally legit...

After reading JinjaX sample, I see the point. I would agree that it's much cleaner... If not for the fact he uses capitalized tags to distinguish between templates and html. I hate it. First off, it just throws me off, I cannot tell at the glance anymore where is the real text, and where is templating voodoo-magic. How do I find the source files fot layout and pagination? Right, I just have to know the convention. Second, it's remotely justifiable and can be attributed to a matter of getting used to only if it produces html. Templating engines are not restricted to html. It could be producing markdown, it could be producing XML. If only the author of this library restrained himself to be less funky and not introduce any ambiguous idioms, it would be pretty perfect. But as it is, I don't think I could use it.



Different tastes, I guess. It's the same syntax that many JavaScript Frontend frameworks like react and Svelte use. I find it much cleaner.

When using Jinja with HTMX you also run into trouble that it doesn't nicely support partials. You could use the jinja_partials library but I just find JinjaX so much more pleasant.


For what it's worth MiniJinja lets you render individual blocks if you so desire: https://docs.rs/minijinja/latest/minijinja/struct.State.html...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: