{% if include.top %}
  {% assign toc__top = site.data.sitenav_index[include.top] %}
  {% assign toc__list = toc__top.children %}
  {% if include.title %}
    <p class="toc__title">
      <a href="{{ site.baseurl }}{{ toc__top.page.url | replace:'index.html','' }}">{{ toc__top.page.title }}</a>
    </p>
  {% endif %}
{% else %}
  {% assign toc__list = site.data.sitenav %}
{% endif %}
<ol class="toc__list list-links">
  {% for toc__item in toc__list %}
    <li>
      {% if toc__item.page %}
        <a href="{{ site.baseurl }}{{ toc__item.page.url | replace:'index.html','' }}">{{ toc__item.page.title }}</a>
      {% endif %}
      {% if toc__item.children %}
        {% include toc.liquid top=toc__item.url %}
      {% endif %}
    </li>
  {% endfor %}
</ol>
