1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-01-29 19:07:30 +01:00

Fix deprecation warning

This commit is contained in:
squidfunk 2017-01-02 08:57:19 +01:00
parent 232e997ddc
commit 9e6d347db0
4 changed files with 14 additions and 14 deletions

View File

@ -24,12 +24,12 @@
</li> </li>
{% elif nav_item == page %} {% elif nav_item == page %}
<li class="md-nav__item"> <li class="md-nav__item">
{% set toc = page.toc %} {% set toc_ = page.toc %}
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc"> <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
{% if "\x3ch1 id=" in page.content %} {% if "\x3ch1 id=" in page.content %}
{% set toc = (toc | first).children %} {% set toc_ = (toc_ | first).children %}
{% endif %} {% endif %}
{% if toc and (toc | first) %} {% if toc_ and (toc_ | first) %}
<label class="md-nav__link md-nav__link--active" for="toc"> <label class="md-nav__link md-nav__link--active" for="toc">
{{ nav_item.title }} {{ nav_item.title }}
</label> </label>

View File

@ -1,12 +1,12 @@
<nav class="md-nav md-nav--secondary"> <nav class="md-nav md-nav--secondary">
{% set toc = page.toc %} {% set toc_ = page.toc %}
{% if "\x3ch1 id=" in page.content %} {% if "\x3ch1 id=" in page.content %}
{% set toc = (toc | first).children %} {% set toc_ = (toc_ | first).children %}
{% endif %} {% endif %}
{% if toc and (toc | first) %} {% if toc_ and (toc_ | first) %}
<label class="md-nav__title" for="toc">Table of contents</label> <label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% for toc_item in toc %} {% for toc_item in toc_ %}
{% include "partials/toc-item.html" %} {% include "partials/toc-item.html" %}
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -57,7 +57,7 @@
<!-- Currently active page --> <!-- Currently active page -->
{% elif nav_item == page %} {% elif nav_item == page %}
<li class="md-nav__item"> <li class="md-nav__item">
{% set toc = page.toc %} {% set toc_ = page.toc %}
<!-- Active checkbox expands items contained within nested section --> <!-- Active checkbox expands items contained within nested section -->
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" <input class="md-toggle md-nav__toggle" data-md-toggle="toc"
@ -65,11 +65,11 @@
<!-- Nasty hack - see partials/toc.html for more information --> <!-- Nasty hack - see partials/toc.html for more information -->
{% if "\x3ch1 id=" in page.content %} {% if "\x3ch1 id=" in page.content %}
{% set toc = (toc | first).children %} {% set toc_ = (toc_ | first).children %}
{% endif %} {% endif %}
<!-- Render table of contents, if not empty --> <!-- Render table of contents, if not empty -->
{% if toc and (toc | first) %} {% if toc_ and (toc_ | first) %}
<label class="md-nav__link md-nav__link--active" for="toc"> <label class="md-nav__link md-nav__link--active" for="toc">
{{ nav_item.title }} {{ nav_item.title }}
</label> </label>

View File

@ -22,7 +22,7 @@
<!-- Table of contents --> <!-- Table of contents -->
<nav class="md-nav md-nav--secondary"> <nav class="md-nav md-nav--secondary">
{% set toc = page.toc %} {% set toc_ = page.toc %}
<!-- <!--
This is a nasty hack that checks whether the content contains a h1 This is a nasty hack that checks whether the content contains a h1
@ -31,14 +31,14 @@
anchor. Therefore we directly continue with the children of the anchor. anchor. Therefore we directly continue with the children of the anchor.
--> -->
{% if "\x3ch1 id=" in page.content %} {% if "\x3ch1 id=" in page.content %}
{% set toc = (toc | first).children %} {% set toc_ = (toc_ | first).children %}
{% endif %} {% endif %}
<!-- Render item list --> <!-- Render item list -->
{% if toc and (toc | first) %} {% if toc_ and (toc_ | first) %}
<label class="md-nav__title" for="toc">Table of contents</label> <label class="md-nav__title" for="toc">Table of contents</label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% for toc_item in toc %} {% for toc_item in toc_ %}
{% include "partials/toc-item.html" %} {% include "partials/toc-item.html" %}
{% endfor %} {% endfor %}
</ul> </ul>