Skip to content

Instantly share code, notes, and snippets.

@andik
andik / dirtree.html
Last active January 22, 2024 19:12
Flask directory listing
<!doctype html>
<title>Path: {{ tree.name }}</title>
<h1>{{ tree.name }}</h1>
<ul>
{%- for item in tree.children recursive %}
<li>{{ item.name }}
{%- if item.children -%}
<ul>{{ loop(item.children) }}</ul>
{%- endif %}</li>
{%- endfor %}