mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
update nav dropdown behavior (#23436)
<!--Delete sections as needed --> ## 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 <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Editorial review Signed-off-by: Craig <craig.osterhout@docker.com>
This commit is contained in:
@@ -79,6 +79,9 @@
|
||||
</button>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{/* Only show expand group button if section has children */}}
|
||||
{{- $hasChildren := gt (len (where .Pages "Params.sitemap" "ne" "false")) 0 }}
|
||||
{{- if $hasChildren }}
|
||||
<!-- Expand group button -->
|
||||
<button
|
||||
@click="expanded = !expanded"
|
||||
@@ -97,6 +100,7 @@
|
||||
{{ partialCached "icon" "arrow_drop_up" "arrow_drop_up" }}
|
||||
</span>
|
||||
</button>
|
||||
{{- end }}
|
||||
</div>
|
||||
<ul
|
||||
:class="{ 'hidden' : !expanded }"
|
||||
|
||||
Reference in New Issue
Block a user