diff --git a/docs/overrides/partials/nav.html b/docs/overrides/partials/nav.html
index d4684d0a6..93d5c8c86 100644
--- a/docs/overrides/partials/nav.html
+++ b/docs/overrides/partials/nav.html
@@ -1,3 +1,5 @@
+{% import "partials/nav-item.html" as item with context %}
+
{% set class = "md-nav md-nav--primary" %}
{% if "navigation.tabs" in features %}
@@ -35,12 +37,11 @@
{% endif %}
-
+
{% for nav_item in nav %}
{% set path = "__nav_" ~ loop.index %}
- {% set level = 1 %}
- {% include "partials/nav-item.html" %}
+ {{ item.render(nav_item, path, 1) }}
{% endfor %}
diff --git a/requirements.txt b/requirements.txt
index 3122dc92b..7451dfc6c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -29,4 +29,4 @@ watchgod==0.8.2
# Documentation
mkdocs==1.5.3
-mkdocs-material==9.1.21
+mkdocs-material==9.5.5