{% for name, album_dict in albums.items() %}
{% with current_ancestor=(album.breadcrumb|length and depth < album.breadcrumb|length and album_dict.self.title == album.breadcrumb[depth][1]) %}
{{ album_dict.self.title }}
{% if current_ancestor %}
{% with albums=album_dict.subalbums, depth=depth+1 %}
{% include './menu.html' %}
{% endwith %}
{% endif %}
{% endwith %}
{% endfor %}