1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-19 10:55:54 +01:00
mkdocs-material/material/partials/tabs-item.html

37 lines
1.2 KiB
HTML
Raw Normal View History

2019-09-28 19:42:54 +02:00
{#-
This file was automatically generated - do not edit
-#}
{% if nav_item.is_homepage or nav_item.url == "index.html" %}
<li class="md-tabs__item">
2020-11-07 16:09:06 +01:00
{% set class = "md-tabs__link" %}
{% if not page.ancestors | length and nav | selectattr("url", page.url) %}
2020-11-07 16:09:06 +01:00
{% set class = "md-tabs__link md-tabs__link--active" %}
{% endif %}
2020-11-07 16:09:06 +01:00
<a href="{{ nav_item.url | url }}" class="{{ class }}">
{{ nav_item.title }}
</a>
</li>
{% elif nav_item.children and nav_item.children | length > 0 %}
{% set title = title | default(nav_item.title) %}
{% if (nav_item.children | first).children %}
{% set nav_item = nav_item.children | first %}
{% include "partials/tabs-item.html" %}
{% else %}
<li class="md-tabs__item">
2020-11-07 16:09:06 +01:00
{% set class = "md-tabs__link" %}
{% if nav_item.active %}
2020-11-07 16:09:06 +01:00
{% set class = "md-tabs__link md-tabs__link--active" %}
{% endif %}
2020-11-07 16:09:06 +01:00
<a href="{{ (nav_item.children | first).url | url }}" class="{{ class }}">
{{ title }}
</a>
</li>
{% endif %}
2020-08-26 20:06:47 +02:00
{% elif nav_item.url.startswith("http") %}
<li class="md-tabs__item">
<a href="{{ nav_item.url | url }}" class="md-tabs__link">
{{ nav_item.title }}
</a>
</li>
{% endif %}