mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fix rendering of empty pane in mobile navigation when no headlines are given
This commit is contained in:
parent
d7ba0134a0
commit
ca0de52b45
@ -24,14 +24,22 @@
|
|||||||
</li>
|
</li>
|
||||||
{% elif nav_item == page %}
|
{% elif nav_item == page %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
|
{% 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">
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
{% if "\x3ch1 id=" in page.content %}
|
||||||
{{ nav_item.title }}
|
{% set toc = (toc | first).children %}
|
||||||
</label>
|
{% endif %}
|
||||||
|
{% if toc and (toc | first) %}
|
||||||
|
<label class="md-nav__link md-nav__link--active" for="toc">
|
||||||
|
{{ nav_item.title }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-nav__link md-nav__link--active">
|
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-nav__link md-nav__link--active">
|
||||||
{{ nav_item.title }}
|
{{ nav_item.title }}
|
||||||
</a>
|
</a>
|
||||||
{% include "partials/toc.html" %}
|
{% if page.toc %}
|
||||||
|
{% include "partials/toc.html" %}
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
|
@ -57,22 +57,32 @@
|
|||||||
<!-- Main navigation item with nested items -->
|
<!-- Main navigation item with nested items -->
|
||||||
{% elif nav_item == page %}
|
{% elif nav_item == page %}
|
||||||
<li class="md-nav__item">
|
<li class="md-nav__item">
|
||||||
|
{% 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"
|
||||||
type="checkbox" id="toc" />
|
type="checkbox" id="toc" />
|
||||||
|
|
||||||
|
<!-- Nasty hack - see partials/toc.html for more information -->
|
||||||
|
{% if "\x3ch1 id=" in page.content %}
|
||||||
|
{% set toc = (toc | first).children %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Expand active pages -->
|
<!-- Expand active pages -->
|
||||||
<label class="md-nav__link md-nav__link--active" for="toc">
|
{% if toc and (toc | first) %}
|
||||||
{{ nav_item.title }}
|
<label class="md-nav__link md-nav__link--active" for="toc">
|
||||||
</label>
|
{{ nav_item.title }}
|
||||||
|
</label>
|
||||||
|
{% endif %}
|
||||||
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}"
|
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}"
|
||||||
class="md-nav__link md-nav__link--active">
|
class="md-nav__link md-nav__link--active">
|
||||||
{{ nav_item.title }}
|
{{ nav_item.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Show table of contents -->
|
<!-- Show table of contents -->
|
||||||
{% include "partials/toc.html" %}
|
{% if page.toc %}
|
||||||
|
{% include "partials/toc.html" %}
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Main navigation item -->
|
<!-- Main navigation item -->
|
||||||
|
Loading…
Reference in New Issue
Block a user