jinja2 - how to expand variable in template name -
in jinja2 i'd follows
{% item in items %} {% include "template-{{item}}.html" %} {% endfor %}
so if items ("a", "c", "d") main template include template-a.html, template-c.html , template-d.html
unfortunately error template-{{item}}.html not exist, variable item not evaluated.
is there way ?
Comments
Post a Comment