2017-01-26 23:10:52 +03:00
|
|
|
<!--
|
2020-02-10 14:34:58 +03:00
|
|
|
Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
2017-01-26 23:10:52 +03:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to
|
|
|
|
deal in the Software without restriction, including without limitation the
|
|
|
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
IN THE SOFTWARE.
|
|
|
|
-->
|
|
|
|
|
2017-01-28 19:56:34 +03:00
|
|
|
<!-- Home page -->
|
2020-02-29 14:23:52 +03:00
|
|
|
{% if nav_item.is_homepage or nav_item.url == "index.html" %}
|
2017-01-28 19:56:34 +03:00
|
|
|
<li class="md-tabs__item">
|
2019-06-15 16:16:14 +03:00
|
|
|
{% if not page.ancestors | length and nav | selectattr("url", page.url) %}
|
2019-11-26 12:03:53 +03:00
|
|
|
<a
|
|
|
|
href="{{ nav_item.url | url }}"
|
|
|
|
class="md-tabs__link md-tabs__link--active"
|
|
|
|
>
|
2019-06-15 16:23:03 +03:00
|
|
|
{{ nav_item.title }}
|
2017-02-26 17:06:50 +03:00
|
|
|
</a>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% else %}
|
2019-08-23 18:32:44 +03:00
|
|
|
<a href="{{ nav_item.url | url }}" class="md-tabs__link">
|
2019-06-15 16:23:03 +03:00
|
|
|
{{ nav_item.title }}
|
2017-02-26 17:06:50 +03:00
|
|
|
</a>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% endif %}
|
2017-01-28 19:56:34 +03:00
|
|
|
</li>
|
2017-02-26 15:59:54 +03:00
|
|
|
|
|
|
|
<!-- Main navigation item with nested items -->
|
2019-06-15 16:16:14 +03:00
|
|
|
{% elif nav_item.children and nav_item.children | length > 0 %}
|
|
|
|
{% set title = title | default(nav_item.title) %}
|
2017-03-02 17:55:22 +03:00
|
|
|
|
|
|
|
<!-- Recurse, if the first item has nested items -->
|
2019-06-15 16:16:14 +03:00
|
|
|
{% if (nav_item.children | first).children %}
|
|
|
|
{% set nav_item = nav_item.children | first %}
|
|
|
|
{% include "partials/tabs-item.html" %}
|
2017-03-02 17:55:22 +03:00
|
|
|
|
|
|
|
<!-- Render item -->
|
2019-06-15 16:16:14 +03:00
|
|
|
{% else %}
|
2017-03-02 17:55:22 +03:00
|
|
|
<li class="md-tabs__item">
|
2019-06-15 16:16:14 +03:00
|
|
|
{% if nav_item.active %}
|
2019-11-26 12:03:53 +03:00
|
|
|
<a
|
|
|
|
href="{{ (nav_item.children | first).url | url }}"
|
|
|
|
class="md-tabs__link md-tabs__link--active"
|
|
|
|
>
|
2019-06-15 16:23:03 +03:00
|
|
|
{{ title }}
|
2017-03-02 17:55:22 +03:00
|
|
|
</a>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% else %}
|
2019-11-26 12:03:53 +03:00
|
|
|
<a
|
|
|
|
href="{{ (nav_item.children | first).url | url }}"
|
|
|
|
class="md-tabs__link"
|
|
|
|
>
|
2019-06-15 16:23:03 +03:00
|
|
|
{{ title }}
|
2017-03-02 17:55:22 +03:00
|
|
|
</a>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% endif %}
|
2017-03-02 17:55:22 +03:00
|
|
|
</li>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% endif %}
|
2020-08-26 21:06:47 +03:00
|
|
|
|
|
|
|
<!-- Main navigation item with external link -->
|
|
|
|
{% 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>
|
2019-06-15 16:16:14 +03:00
|
|
|
{% endif %}
|