layouts: add toc_max and toc_min (#22159)

<!--Delete sections as needed -->

## Description

Fix toc_min and toc_max for right nav as defined in
https://docs.docker.com/contribute/file-conventions/#front-matter

Comparison with existing `toc_max: 2`:
https://docs.docker.com/desktop/release-notes/

https://deploy-preview-22159--docsdocker.netlify.app/desktop/release-notes/

## 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:
Craig Osterhout
2025-03-04 13:30:16 -08:00
committed by GitHub
parent fd28bc89e8
commit b6456b6df3

View File

@@ -20,8 +20,8 @@
{{- end }}
{{- define "walkHeadingFragments" }}
{{- $min := 2 }}
{{- $max := 3 }}
{{- $min := default 2 page.Params.toc_min }}
{{- $max := default 3 page.Params.toc_max }}
<ul class="pl-2">
{{- range . }}
{{- if and (ge .Level $min) (le .Level $max) }}