From 991fd7a6d67ee017c57beaaa21fc31c4bee7944d Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Sat, 7 Oct 2023 06:48:07 +0800 Subject: feat(version): versions --- src/templates/partials/tabs-item.html | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/templates/partials/tabs-item.html (limited to 'src/templates/partials/tabs-item.html') diff --git a/src/templates/partials/tabs-item.html b/src/templates/partials/tabs-item.html new file mode 100644 index 00000000..7a12a742 --- /dev/null +++ b/src/templates/partials/tabs-item.html @@ -0,0 +1,71 @@ + + + +{% macro render_content(nav_item, ref = nav_item) %} + + + {% if nav_item == ref or "navigation.indexes" in features %} + {% if nav_item.is_index and nav_item.meta.icon %} + {% include ".icons/" ~ nav_item.meta.icon ~ ".svg" %} + {% endif %} + {% endif %} + + + {{ ref.title }} +{% endmacro %} + + +{% macro render(nav_item, ref = nav_item) %} + + + {% set class = "md-tabs__item" %} + {% if ref.active %} + {% set class = class ~ " md-tabs__item--active" %} + {% endif %} + + + {% if nav_item.children %} + {% set first = nav_item.children | first %} + + + {% if first.children %} + {{ render(first, ref) }} + + + {% else %} +
  • + + {{ render_content(first, ref) }} + +
  • + {% endif %} + + + {% else %} +
  • + + {{ render_content(nav_item) }} + +
  • + {% endif %} +{% endmacro %} -- cgit v1.2.3-70-g09d2