{% extends "templates/template.html" %}
<ul>
      {%- for item in tree.children recursive %}
      {%- set name = item.name.split('/')[-1] -%}
      {%- if item.type != "directory" -%}
      <li><a href={{ item.name }}>{{ name }}</a></li>
        {%- else -%}
        {%- if item.children|length -%}
        <li>{{ name }}</li>
        {%- endif -%}
        {%- endif -%}
    {%- if item.children and item.children|length -%}
    <ul>{{ loop(item.children) }}</ul></li>
    {%- endif %}
{%- endfor %}
</ul>
{% endblock %}
