Adds active state to sidebar links

This commit is contained in:
Adam Hollett
2016-03-15 19:36:24 -04:00
committed by Tetsuro
parent f0883806c4
commit ea16fe9b24
+2 -2
View File
@@ -8,8 +8,8 @@
<h3 class="section__header">{{ section | capitalize }}</h3>
<ul class="section__links">
{% for page in site.pages %}{% if page.url contains section/ %}{% unless page.path contains "index" %}
<li><a href="{{ page.url | prepend: site.baseurl }}" class="section__link">{{ page.title }}</a></li>
{% for item in site.pages %}{% if item.url contains section/ %}{% unless item.path contains "index" %}
<li><a href="{{ item.url | prepend: site.baseurl }}" class="section__link{% if item.url contains page.url %} section__link--is-active {% endif %}">{{ item.title }}</a></li>
{% endunless %}{% endif %}{% endfor %}
</ul>
{% endfor %}