{% set classes = [
  'breadcrumbs',
] %}

{% set breadcrumb_classes = [
  'breadcrumb-list',
]|merge(breadcrumb_extra_classes ? breadcrumb_extra_classes : []) %}

{% set breadcrumb_item_classes = [
  'breadcrumb-item',
]|merge(breadcrumb_item_extra_classes ? breadcrumb_item_extra_classes : []) %}

{% if breadcrumb %}
  <nav {{ attributes.addClass(classes).setAttribute('role', 'navigation').setAttribute('aria-labelledby', 'system-breadcrumb') }}>
    <h2 id="system-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
    <ol class="{{ breadcrumb_classes|join(' ') }}">
      {% for item in breadcrumb %}
        <li class="{{ breadcrumb_item_classes|join(' ') }} {{ not item.url ? 'active' }}">
          {% if item.url %}
            <a href="{{ item.url }}">{{ item.text }}</a>
          {% else %}
            {{ item.text }}
          {% endif %}
        </li>
      {% endfor %}
    </ol>
  </nav>
{% endif %}