top | item 30146647

(no title)

Dauros | 4 years ago

Yes, Go templating is quite hard. There was a feature request[1] to implement the Django/Jinja2-like Pongo2 template engine[2], but got rejected because it would have been a too big change.

[1]: https://github.com/gohugoio/hugo/issues/1359

[2]: https://github.com/flosch/pongo2

discuss

order

olifante|4 years ago

Templates are the ugliest part of Django. They are completely unaware of the target syntax, so very often the template itself cannot be validated as HTML, which makes it difficult to lint or reformat.

The only tool I'm aware of that can (mostly) correctly reformat Django templates is the PyCharm/IntelliJ family of IDEs, but their reformatting often introduces subtle breakage (such as adding new lines inside tag attributes) and requires careful review.