Files
gitea-pages/_includes/sidebar.html
Mike Neumegen a6d30be627 cleanup
2016-06-10 00:33:58 +12:00

41 lines
1.4 KiB
HTML

{% assign product = site.collections | where: "label", include.collection | first %}
<div class="col-md-3"> <!-- Sidebar Column -->
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">
{{ product.title }} {{ product.version }}
</li>
{% for category in site.data.sub_navigation[product.label] %}
{% assign items = product.docs | where: "category", category %}
{% assign items = items | sort: 'weight' %}
{% assign number_of_items = items | size %}
{% if number_of_items > 0 %}
<li>
<a href="#">
{{ category }}
</a>
<ul>
{% for item in items %}
<li {% if page.url == item.url %}class="active"{% endif %}>
<a href="{{ item.url | prepend: site.baseurl }}">
{{ item.title }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</p>
-->
</li>
</ul>
</div>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<script>$("li.active").parents('li').toggleClass("active");</script>