Mirror/docs/_includes/f_sidebar_nav.html

36 lines
1.1 KiB
HTML
Raw Normal View History

2018-12-20 16:06:24 +00:00
{% if include.item.children %}
<a href="#submenu_{{include.id}}" aria-controls="submenu_{{include.id}}" data-toggle="collapse" aria-expanded="false" class="bd-toc-link dropdown-toggle">{{include.item.title}}</a>
{% assign pageurl = page.url | remove: '.html' %}
{% capture capturechild %}
{% for child in include.item.children %}
{% assign active = "" %}
{% if pageurl == child.url %}
{% assign active = "active bd-sidenav-active" %}
{% endif %}
<li class="hello {{active}}">
{% assign childid = include.id | append: '_' | append: forloop.index %}
{% include f_sidebar_nav.html item=child id=childid %}
</li>
{% endfor %}
{% endcapture %}
{% assign show = "" %}
{% if capturechild contains 'bd-sidenav-active' %}
{% assign show = "show" %}
{% endif %}
<ul class="collapse nav bd-sidenav {{show}}" id="submenu_{{include.id}}">
{{ capturechild }}
</ul>
{% else %}
<a href="{{include.item.url | relative_url}}">{{include.item.title}}</a>
{% endif %}