{% if not nav_item.children %}
  <cds-side-nav-menu-item href="{{ nav_item.url | url }}" {% if nav_item.active or (page.meta and nav_item.title == page.meta.nav_title) %}expanded{% endif %}>
    {{ nav_item.title }}
  </cds-side-nav-menu-item>
{% else %}
  <cds-side-nav-menu title="{{ nav_item.title }}" {% if nav_item.active or (page.meta and nav_item.title == page.meta.nav_title) %}expanded{% endif %}>
    {% for nav_item in nav_item.children %}
      {% include "nav.html.j2" %}
    {% endfor %}
  </cds-side-nav-menu>
{% endif %}
