items">
  {% for matchingPage in matchingPages %}
    {% assign lastSixCharsOfPath = matchingPage.id | slice: -6, 6 %}

    {% if lastSixCharsOfPath == '/index' %}
      {% assign lengthOfPathWithoutIndex = matchingPage.id | size | minus: 6 %}
      {% assign pathWithoutIndex = matchingPage.id | slice: 0, lengthOfPathWithoutIndex %}
    {% else %}
      {% assign pathWithoutIndex = matchingPage.id %}
    {% endif %}

    {% if pathWithoutIndex == include.path %}
      {% continue %}
    {% endif %}

    {%
