From d50a8c3fbe39b9690edb813110ad2b82ef50e189 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sun, 1 Feb 2026 09:16:47 -0700 Subject: [PATCH] feat(nav): add context-aware expansion for nested navigation Children are only visible when user is viewing a page within that section. Uses Tera's starting_with test to detect ancestor relationship. --- docs/static/style.css | 6 +++++- docs/templates/base.html | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/static/style.css b/docs/static/style.css index dc100d3..e202e95 100644 --- a/docs/static/style.css +++ b/docs/static/style.css @@ -98,11 +98,15 @@ body { margin-left: 1rem; padding-left: 0.5rem; border-left: 1px solid var(--border); - display: flex; + display: none; flex-direction: column; gap: 0.25rem; } +.sidebar .nav-children.expanded { + display: flex; +} + .sidebar .nav-children a { font-size: 0.9rem; } diff --git a/docs/templates/base.html b/docs/templates/base.html index f3374ce..a7d9e78 100644 --- a/docs/templates/base.html +++ b/docs/templates/base.html @@ -35,9 +35,11 @@