1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-01 02:27:17 +01:00
mkdocs-material/material/partials/tabs-item.html

32 lines
1.1 KiB
HTML
Raw Normal View History

2017-02-26 13:59:54 +01:00
{% if nav_item.is_homepage %}
<li class="md-tabs__item">
2017-02-26 15:06:50 +01:00
{% if not page.ancestors | length and nav | selectattr("url", page.url) %}
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-tabs__link md-tabs__link--active">
{{ nav_item.title }}
</a>
{% else %}
<a href="{{ nav_item.url }}" title="{{ nav_item.title }}" class="md-tabs__link">
{{ nav_item.title }}
</a>
{% endif %}
</li>
2017-02-26 13:59:54 +01:00
{% elif nav_item.children and nav_item.children | length > 0 %}
{% 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 %}