1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 09:20:52 +01:00

Drop 'with' in templates to be compatible with Jinja < 2.9

This commit is contained in:
squidfunk 2017-01-10 00:15:44 +01:00
parent 6033519d15
commit cecd1f1d7c
4 changed files with 9 additions and 13 deletions

View File

@ -15,9 +15,8 @@
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% set base = path %} {% set base = path %}
{% for nav_item in nav_item.children %} {% for nav_item in nav_item.children %}
{% with path = base + "-" + loop.index | string %} {% set path = base + "-" + loop.index | string %}
{% include "partials/nav-item.html" %} {% include "partials/nav-item.html" %}
{% endwith %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -16,9 +16,8 @@
{% endif %} {% endif %}
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %} {% for nav_item in nav %}
{% with path = "nav-" + loop.index | string %} {% set path = "nav-" + loop.index | string %}
{% include "partials/nav-item.html" %} {% include "partials/nav-item.html" %}
{% endwith %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -42,13 +42,12 @@
{{ nav_item.title}} {{ nav_item.title}}
</label> </label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
<!-- Render nested item list --> <!-- Render nested item list -->
{% set base = path %}
{% for nav_item in nav_item.children %} {% for nav_item in nav_item.children %}
{% with path = base + "-" + loop.index | string %} {% set path = base + "-" + loop.index | string %}
{% include "partials/nav-item.html" %} {% include "partials/nav-item.html" %}
{% endwith %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>

View File

@ -39,9 +39,8 @@
{% endif %} {% endif %}
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %} {% for nav_item in nav %}
{% with path = "nav-" + loop.index | string %} {% set path = "nav-" + loop.index | string %}
{% include "partials/nav-item.html" %} {% include "partials/nav-item.html" %}
{% endwith %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>