HACKER Q&A
📣 mroche

What HTML template engines do you use?


I'm planning on making a small web app using SSR rather than splitting the backend and client work. In researching options for the project (Go based), I've "discovered" that there's a _lot_ more to templates than what I've used in the past (Jinja2 via Django, Flask, and Ansible).

So to the actual web developers here, what template engines do you use and why? I've never worked with compiled templates but they seem interesting, though I don't know their cost/benefit tradeoffs very well yet.

Your choice of language, stack, syntax preference, what-have-you! I'm just genuinely curious about the broader templating ecosystem and workflows.


  👤 surprisetalk Accepted Answer ✓
I use Elixir's native EEX templating for some personal projects.

My Elixir script takes markdown files with YAML front matter and produces static HTML pages, which are served via Cloudflare Pages.

[1] https://hexdocs.pm/earmark/1.4.2/Earmark.html

[2] https://hexdocs.pm/yaml_front_matter/readme.html

[3] https://pages.cloudflare.com


👤 webmaven
I really like the TAL, TALES, METAL syntaxes (also known as Zope Page Templates). There are implementations of these syntaxes in a wide variety of languages, the one I use most is the Python implementation known as Chameleon:

https://chameleon.readthedocs.io/en/latest/


👤 mattbillenstein
Re Python, I like Mako. Jinja2 essentially has a python-like DSL, but I already know python, so it just seemed like a hassle to learn another thing.

👤 sylware
I use manually coded templates. With a bit of rigourous structure, it is more than enough. I do that using plain and simple C.

👤 PaulHoule
Jinja2 in Python, Freemarker in Java