Commit db5d1b5e authored by Chris Lamb's avatar Chris Lamb 💬

Make the sidebar highlight (eg.) "docs" when viewing any docs pages.

parent 0d40980a
......@@ -4,7 +4,7 @@
{% for page in sorted_pages %}
{% if page.title and page.order >= 0 %}
<li class="list-group-item rb-main-sidebar">
<a href="{{ page.url | prepend: site.baseurl }}" class="sidebar__link__darkGray">{{ page.title }}</a>
<a href="{{ page.url | prepend: site.baseurl }}" class="sidebar__link__darkGray {% if page.url == "/" %}never-active{% endif %}">{{ page.title }}</a>
</li>
{% endif %}
{% endfor %}
......
......@@ -18,9 +18,9 @@
$(document).ready(function () {
var listItems = $('.rb-main-sidebar');
$.each(listItems, function (key, litem) {
var aElement = $(this).children(litem)[0];
var aElement = $(this).children(litem).not('.never-active')[0];
if(aElement.href == document.URL.split('#')[0]) {
if(aElement && document.URL.split('#')[0].indexOf(aElement.href) === 0) {
$(litem).addClass('active');
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment