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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c++ - libcurl curl_easy_setopt "Unknown error" -

protocol buffers - zeromq with protobuf segmentation fault while parsing in c++ -