{#- Tarn: copy of Zensical's partials/tabs-item.html with Tarn navigation attributes supplied by partials/tarn.html. Source: https://raw.githubusercontent.com/zensical/ui/v0.0.39/dist/partials/tabs-item.html (UI v0.0.39 = Zensical 0.0.73). After a Zensical upgrade, review these calls and run scripts/check_upstream.py. -#} {% import "partials/tarn.html" as tarn with context %} {% macro render_content(nav_item, ref) %} {% set ref = ref or nav_item %} {{ ref.title or nav_item.title }} {% endmacro %} {% macro render(nav_item, ref) %} {% set ref = ref or nav_item %} {% set class = "md-tabs__item" %} {% if ref.active %} {% set class = class ~ " md-tabs__item--active" %} {% endif %} {% if nav_item.children %} {% set _ = namespace(index = none) %} {% if "navigation.indexes" in features %} {% for item in nav_item.children %} {% if item.is_index and _.index is none %} {% set _.index = item %} {% endif %} {% endfor %} {% endif %} {% set index = _.index %} {% set first = index or nav_item.children | first %} {% if first.children %} {{ render(first, ref) }} {% else %}
  • {{ render_content(first, ref) }}
  • {% endif %} {% else %}
  • {{ render_content(nav_item) }}
  • {% endif %} {% endmacro %}