From 466db493266f3132d69a539b2eec5139cb618748 Mon Sep 17 00:00:00 2001 From: Craig Osterhout <103533812+craig-osterhout@users.noreply.github.com> Date: Mon, 22 Sep 2025 08:00:15 -0700 Subject: [PATCH] update nav dropdown behavior (#23436) ## Description Change how the section drop-down arrows are rendered in the side-nav. Currently, they generate for any folder, even if it just contains an index. To not generate the arrow, the index would have to be taken out of the folder and renamed as the folder. This change now counts how many children under the index, and only generates the arrow if it has children (that aren't hidden from the nav). For example, see how there is an arrow for the mcp gateway, but it expands to nothing. Current: https://docs.docker.com/ai/mcp-gateway/ Updated: https://deploy-preview-23436--docsdocker.netlify.app/ai/mcp-gateway/ ## Related issues or tickets ## Reviews - [ ] Editorial review Signed-off-by: Craig --- layouts/partials/sidebar/sections.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/sidebar/sections.html b/layouts/partials/sidebar/sections.html index 0e4b2b9771..e834404420 100644 --- a/layouts/partials/sidebar/sections.html +++ b/layouts/partials/sidebar/sections.html @@ -79,6 +79,9 @@ {{- end }} + {{/* Only show expand group button if section has children */}} + {{- $hasChildren := gt (len (where .Pages "Params.sitemap" "ne" "false")) 0 }} + {{- if $hasChildren }} + {{- end }}