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>
|
||||
{% elif nav_item == page %}
|
||||
<li class="md-nav__item">
|
||||
{% set toc = page.toc %}
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
|
||||
{% if "\x3ch1 id=" in page.content %}
|
||||
{% set toc = (toc | first).children %}
|
||||
{% 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">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% if page.toc %}
|
||||
{% include "partials/toc.html" %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="md-nav__item">
|
||||
|
@ -57,22 +57,32 @@
|
||||
<!-- Main navigation item with nested items -->
|
||||
{% elif nav_item == page %}
|
||||
<li class="md-nav__item">
|
||||
{% set toc = page.toc %}
|
||||
|
||||
<!-- Active checkbox expands items contained within nested section -->
|
||||
<input class="md-toggle md-nav__toggle" data-md-toggle="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 -->
|
||||
{% 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">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
|
||||
<!-- Show table of contents -->
|
||||
{% if page.toc %}
|
||||
{% include "partials/toc.html" %}
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<!-- Main navigation item -->
|
||||
|
Loading…
Reference in New Issue
Block a user