| <div class="toc"> | |
| {% assign path = page.path | remove: "/index.adoc" | remove_first: "_" | remove_first: page.collection | remove_first: "/" %} | |
| {% assign current_guide = path | split: "/" | first %} | |
| {% assign section = path | remove: current_guide | remove : "/" %} | |
| {% if current_guide != nil %} | |
| {% assign current_guide_url = current_guide | prepend: "/" %} | |
| {% assign guide = site.data.toc | where: "url", current_guide_url | first %} | |
| {% if section != "" %} | |
| {% assign section_url = "/" | append: current_guide | append: "/" | append: section %} | |
| {% assign sect = guide.items | where: "url", section_url | first %} | |
| {% include section-toc.html section=sect title=false %} | |
| {% else %} | |
| <ul> | |
| {% for sect in guide.items %} | |
| <li> | |
| {% include section-toc.html section=sect title=true%} | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| {% endif %} | |
| {% else %} | |
| {% for guide in site.data.toc %} | |
| <h2> | |
| <a href="{{site.attrs.base_url}}{{guide.url}}" class=''>{{guide.title}}</a> </h2> | |
| {% if guide.items %} | |
| <ul> | |
| {% for sect in guide.items %} | |
| <li> | |
| {% include section-toc.html section=sect title=true%} | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| {% endif %} | |
| {% endfor %} | |
| {% endif %} | |
| </div> |