File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 {% set toc = page.toc %}
4141 < input class ="md-nav__toggle md-toggle " data-md-toggle ="toc " type ="checkbox " id ="__toc ">
4242 {% set first = toc | first %}
43- {% if first is defined and first.level == 1 %}
43+ {% if first and first.level == 1 %}
4444 {% set toc = first.children %}
4545 {% endif %}
46- {% if toc is iterable %}
46+ {% if toc %}
4747 < label class ="md-nav__link md-nav__link--active " for ="__toc ">
4848 {{ nav_item.title }}
4949 < span class ="md-nav__icon md-icon "> </ span >
5252 < a href ="{{ nav_item.url | url }} " class ="md-nav__link md-nav__link--active ">
5353 {{ nav_item.title }}
5454 </ a >
55- {% if toc is iterable %}
55+ {% if toc %}
5656 {% include "partials/toc.html" %}
5757 {% endif %}
5858 </ li >
Original file line number Diff line number Diff line change 55< nav class ="md-nav md-nav--secondary " aria-label ="{{ lang.t('toc.title') }} ">
66 {% set toc = page.toc %}
77 {% set first = toc | first %}
8- {% if first is defined and first.level == 1 %}
8+ {% if first and first.level == 1 %}
99 {% set toc = first.children %}
1010 {% endif %}
11- {% if toc is iterable %}
11+ {% if toc %}
1212 < label class ="md-nav__title " for ="__toc ">
1313 < span class ="md-nav__icon md-icon "> </ span >
1414 {{ lang.t("toc.title") }}
Original file line number Diff line number Diff line change 102102
103103 <!-- Hack: see partials/toc.html for more information -->
104104 {% set first = toc | first %}
105- {% if first is defined and first.level == 1 %}
105+ {% if first and first.level == 1 %}
106106 {% set toc = first.children %}
107107 {% endif %}
108108
109109 <!-- Render table of contents, if not empty -->
110- {% if toc is iterable %}
110+ {% if toc %}
111111 < label class ="md-nav__link md-nav__link--active " for ="__toc ">
112112 {{ nav_item.title }}
113113 < span class ="md-nav__icon md-icon "> </ span >
121121 </ a >
122122
123123 <!-- Show table of contents -->
124- {% if toc is iterable %}
124+ {% if toc %}
125125 {% include "partials/toc.html" %}
126126 {% endif %}
127127 </ li >
Original file line number Diff line number Diff line change 3333 directly continue with the children of the anchor.
3434 -->
3535 {% set first = toc | first %}
36- {% if first is defined and first.level == 1 %}
36+ {% if first and first.level == 1 %}
3737 {% set toc = first.children %}
3838 {% endif %}
3939
4040 <!-- Render item list -->
41- {% if toc is iterable %}
41+ {% if toc %}
4242 < label class ="md-nav__title " for ="__toc ">
4343 < span class ="md-nav__icon md-icon "> </ span >
4444 {{ lang.t("toc.title") }}
You can’t perform that action at this time.
0 commit comments