{% load wagtailcore_tags %}

{% if ancestors %}
    <nav class="breadcrumb-container" aria-label="Breadcrumb">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <ol class="breadcrumb">
                        {% for ancestor in ancestors %}
                            {% if forloop.last %}
                                <li aria-current="page">{{ ancestor }}</li>
                            {% else %}
                                <li><a href="{% pageurl ancestor %}">{% if forloop.first %}Home{% else %}{{ ancestor }}{% endif %}</a>
                                    {% include "includes/chevron-icon.html" with class="breadcrumb__chevron-icon" %}</li>
                            {% endif %}
                        {% endfor %}
                    </ol>
                </div>
            </div>
        </div>
    </nav>
{% endif %}
