<div class="col-12 col-md-3 col-xl-2 bd-sidebar">

  <form class="bd-search d-flex align-items-center" action="{{ pathto('search') }}" method="get">
    <input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
  </form>

  <nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">

    <div class="bd-toc-item active">
    {% set nav = get_nav_object(maxdepth=3) %}

    <ul class="nav bd-sidenav">
      {% for main_nav_item in nav %}
        {% if main_nav_item.active %}
          {% for nav_item in main_nav_item.children %}
            {% if nav_item.children %}
              <li class="{% if nav_item.active%}active{% endif %}">
                  <a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
                  <ul>
                  {% for nav_item in nav_item.children %}
                      <li class="{% if nav_item.active%}active{% endif %}">
                          <a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
                      </li>
                  {% endfor %}
                  </ul>
              </li>
            {% else %}
              <li class="{% if nav_item.active%}active{% endif %}">
                  <a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
              </li>
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
    </ul>

  </nav>
</div>
