{% set files = files | default(entities) | select('public') | list %}
<div class="entities featured">
    {% for file in files %}
        {% if files[loop.index0 - 1] is defined %}
            {% set previous_file = files[loop.index0 - 1] %}
        {% endif %}
        {% if files[loop.index0 + 1] is defined %}
            {% set next_file = files[loop.index0 + 1] %}
        {% endif %}
        {% include 'file.html.j2' %}
    {% endfor %}
</div>
