Moya's template language is a spiritual successor to Django, and Jinja templates. It borrows a number of constructs from both, and adds a few of its own.
There is a slight difference in the syntax in that variables are substituted with ${variable}
rather than {{ variable }}
, but tags still use the familiar {% tag %}
syntax.
Template languages are generally quite extensible, so there is probably nothing that Moya templates can do that Django / Jinja can't (via a plugin or extension), but there are a few things which are I think are more elegant in Moya's templates language (and built-in). I'm going to talk about a few of them in this post.
How often have you written code like this? continue reading…