Keats / tera

A template engine for Rust based on Jinja2/Django
http://keats.github.io/tera/
MIT License
3.43k stars 279 forks source link

about hashmap #844

Open dingchenghong opened 1 year ago

dingchenghong commented 1 year ago

i have a hashmap in context ,eg: let vo: HashMap<u8, String> = HashMap::new(); then in my html template file it is: {% for k, v in vo %} {% if k == 5 %}

key is 5

{% else %}
    <p> key is not 5 </p>
{% endif %}

{% endfor %} i had inserted a 5 key into vo, but it do not work. it can get the value but can not enter {% if k == 5 %} , i do not know why