mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed missing link in tabs navigation on deeply nested items
This commit is contained in:
parent
009b41cdb1
commit
bbc48e75bf
@ -11,15 +11,21 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
{% elif nav_item.children and nav_item.children | length > 0 %}
|
||||
<li class="md-tabs__item">
|
||||
{% if nav_item.active %}
|
||||
<a href="{{ (nav_item.children | first).url }}" title="{{ nav_item.title }}" class="md-tabs__link md-tabs__link--active">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ (nav_item.children | first).url }}" title="{{ nav_item.title }}" class="md-tabs__link">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% set title = title | default(nav_item.title) %}
|
||||
{% if (nav_item.children | first).children | length > 0 %}
|
||||
{% set nav_item = nav_item.children | first %}
|
||||
{% include "partials/tabs-item.html" %}
|
||||
{% else %}
|
||||
<li class="md-tabs__item">
|
||||
{% if nav_item.active %}
|
||||
<a href="{{ (nav_item.children | first).url }}" title="{{ title }}" class="md-tabs__link md-tabs__link--active">
|
||||
{{ title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ (nav_item.children | first).url }}" title="{{ title }}" class="md-tabs__link">
|
||||
{{ title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -38,18 +38,27 @@
|
||||
|
||||
<!-- Main navigation item with nested items -->
|
||||
{% elif nav_item.children and nav_item.children | length > 0 %}
|
||||
<li class="md-tabs__item">
|
||||
{% if nav_item.active %}
|
||||
<a href="{{ (nav_item.children | first).url }}"
|
||||
title="{{ nav_item.title }}"
|
||||
class="md-tabs__link md-tabs__link--active">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ (nav_item.children | first).url }}"
|
||||
title="{{ nav_item.title }}" class="md-tabs__link">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% set title = title | default(nav_item.title) %}
|
||||
|
||||
<!-- Recurse, if the first item has nested items -->
|
||||
{% if (nav_item.children | first).children | length > 0 %}
|
||||
{% set nav_item = nav_item.children | first %}
|
||||
{% include "partials/tabs-item.html" %}
|
||||
|
||||
<!-- Render item -->
|
||||
{% else %}
|
||||
<li class="md-tabs__item">
|
||||
{% if nav_item.active %}
|
||||
<a href="{{ (nav_item.children | first).url }}"
|
||||
title="{{ title }}" class="md-tabs__link md-tabs__link--active">
|
||||
{{ title }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ (nav_item.children | first).url }}"
|
||||
title="{{ title }}" class="md-tabs__link">
|
||||
{{ title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user