mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Activate root tab when there'e an active page on the root level
This commit is contained in:
parent
9a36dd67b2
commit
79f277c8fe
@ -4,7 +4,7 @@
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% elif nav_item.url == base_url %}
|
||||
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-tabs__link {% if nav_item.active %} md-tabs__link--active {% endif %}">
|
||||
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-tabs__link {% for nav_item_ in nav %} {{nav_item_.children | length}} {% if nav_item_.url == page.url and nav_item_.children | length == 0 %} md-tabs__link--active {% endif %} {% endfor %}">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@ -33,14 +33,22 @@
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
|
||||
<!-- Main navigation item -->
|
||||
|
||||
<!-- Home page -->
|
||||
{% elif nav_item.url == base_url %}
|
||||
|
||||
<!--
|
||||
Hack: the item should be active, if we're sure that we're on the first
|
||||
level of the tree and the current item doesn't have children
|
||||
-->
|
||||
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}"
|
||||
class="md-tabs__link
|
||||
{% if nav_item.active %}
|
||||
md-tabs__link--active
|
||||
{% endif %}">
|
||||
{% for nav_item_ in nav %}
|
||||
{{nav_item_.children | length}}
|
||||
{% if nav_item_.url == page.url and
|
||||
nav_item_.children | length == 0 %}
|
||||
md-tabs__link--active
|
||||
{% endif %}
|
||||
{% endfor %}">
|
||||
{{ nav_item.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user