mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 00:55:11 -07:00
Adds active state to sidebar links
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
<h3 class="section__header">{{ section | capitalize }}</h3>
|
<h3 class="section__header">{{ section | capitalize }}</h3>
|
||||||
|
|
||||||
<ul class="section__links">
|
<ul class="section__links">
|
||||||
{% for page in site.pages %}{% if page.url contains section/ %}{% unless page.path contains "index" %}
|
{% for item in site.pages %}{% if item.url contains section/ %}{% unless item.path contains "index" %}
|
||||||
<li><a href="{{ page.url | prepend: site.baseurl }}" class="section__link">{{ page.title }}</a></li>
|
<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 %}
|
{% endunless %}{% endif %}{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user