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 5fd635b07..2671a6df1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -15,7 +15,7 @@ trio==0.24.0
# Documentation
mkdocs==1.5.3
-mkdocs-material==9.1.17
+mkdocs-material==9.5.5
mkautodoc==0.2.0
# Packaging