Mirror/docs/_includes/f_sidebar_nav.html

36 lines
1.2 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 = "" %}
2018-12-21 01:39:41 +00:00
{% assign childurlfolder = child.url | append: '/' %}
{% if child.url and (pageurl == child.url or pageurl == childurlfolder) %}
2018-12-20 16:06:24 +00:00
{% assign active = "active bd-sidenav-active" %}
{% endif %}
<li class="{{active}}">
2018-12-20 16:06:24 +00:00
{% 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 %}