From d52f6052005f4e4fa701e90b3b60f7ebf13fe035 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 26 Feb 2017 15:06:50 +0100 Subject: [PATCH] Refactored and cleaned up partials --- material/partials/header.html | 10 ++++---- material/partials/tabs-item.html | 24 +++++++++++++++----- material/partials/tabs.html | 6 ++++- src/base.html | 4 ++-- src/partials/header.html | 10 ++++---- src/partials/nav.html | 6 +++++ src/partials/tabs-item.html | 39 +++++++++++++++++++------------- src/partials/tabs.html | 14 +++++++----- 8 files changed, 72 insertions(+), 41 deletions(-) diff --git a/material/partials/header.html b/material/partials/header.html index 39e85d2ca..fda797783 100644 --- a/material/partials/header.html +++ b/material/partials/header.html @@ -35,11 +35,11 @@ {% endblock %}
-
- {% if config.repo_url %} - {% include "partials/source.html" %} - {% endif %} -
+
+ {% if config.repo_url %} + {% include "partials/source.html" %} + {% endif %} +
diff --git a/material/partials/tabs-item.html b/material/partials/tabs-item.html index 6649bbe94..aef42d77e 100644 --- a/material/partials/tabs-item.html +++ b/material/partials/tabs-item.html @@ -1,13 +1,25 @@ {% if nav_item.is_homepage %}
  • - - {{ nav_item.title }} - + {% if not page.ancestors | length and nav | selectattr("url", page.url) %} + + {{ nav_item.title }} + + {% else %} + + {{ nav_item.title }} + + {% endif %}
  • {% elif nav_item.children and nav_item.children | length > 0 %}
  • - - {{ nav_item.title }} - + {% if nav_item.active %} + + {{ nav_item.title }} + + {% else %} + + {{ nav_item.title }} + + {% endif %}
  • {% endif %} diff --git a/material/partials/tabs.html b/material/partials/tabs.html index 3ed208f82..e040436bf 100644 --- a/material/partials/tabs.html +++ b/material/partials/tabs.html @@ -1,4 +1,8 @@ -