hacks-guide-minimal-mistake.../_includes/nav_list
iBug ♦ bcd6126612
Use relative_url and absolute_url where possible (#2387)
* Use relative_url and absolute_url where possible

Drops the `contains "://"` check, adopt Jekyll 3.7
Ref: https://github.com/mmistakes/minimal-mistakes/pull/2385#issuecomment-579882236

* One more unneeded {% assign %}

* Remove one more assign as noted by mmistakes

* Consolidate 4 more captures

* Consolidate an extra assign on "active" class
2020-03-06 15:37:07 -05:00

27 lines
1,002 B
Plaintext

{% assign navigation = site.data.navigation[include.nav] %}
<nav class="nav__list">
{% if page.sidebar.title %}<h3 class="nav__title" style="padding-left: 0;">{{ page.sidebar.title }}</h3>{% endif %}
<input id="ac-toc" name="accordion-toc" type="checkbox" />
<label for="ac-toc">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle Menu" }}</label>
<ul class="nav__items">
{% for nav in navigation %}
<li>
{% if nav.url %}
<a href="{{ nav.url | relative_url }}"><span class="nav__sub-title">{{ nav.title }}</span></a>
{% else %}
<span class="nav__sub-title">{{ nav.title }}</span>
{% endif %}
{% if nav.children != null %}
<ul>
{% for child in nav.children %}
<li><a href="{{ child.url | relative_url }}"{% if child.url == page.url %} class="active"{% endif %}>{{ child.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>