Repository navigation
Support a third hierarchy level in the main and On this page menus - #540
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Active issues cause incorrect heading nesting after level transitions and push long navigation links onto a separate line instead of wrapping beside the arrow.
2 open issues
What changed in this PR
This PR extends the guide’s navigation to show a third page level and represent heading hierarchy in the “On this page” menu.
Changes:
- Includes depth-5 pages in the main menu and indents nested navigation.
- Builds nested table-of-contents lists from h2, h3, and h4 headings.
- Adds tests for deeper navigation and heading nesting, including skipped levels.
| File | Description |
|---|---|
apps/frontend/static_src/scss/components/toc.scss |
Adds indentation and flex wrapping for nested contents lists. |
apps/frontend/static_src/scss/components/navigation.scss |
Indents nested main-menu lists. |
apps/core/tests/test_header.py |
Adds coverage for a third-level menu page. |
apps/core/tests/test_content_page.py |
Tests nested headings, skipped levels, and headings starting at h3. |
apps/core/templatetags/core_tags.py |
Extends the header query to include depth-5 pages. |
apps/core/models/content.py |
Generates nested contents lists from h2–h4 headings. |
Review effort: Balanced
| while len(open_items) > 1 and level <= open_items[-2]: | ||
| open_items.pop() | ||
| toc += "</li></ul>" | ||
| toc += "</li>" |
| li { | ||
| display: flex; | ||
| align-items: center; | ||
| flex-wrap: wrap; |
thibaudcolas
force-pushed
the
thibaudcolas/hierarchy-level-menus
branch
from
November 10, 2026 17:14
27a98c5 to
c3de9a2
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
The main menu now supports one more level of the site’s page hierarchy, and the "On this page" menu now reflects the h2 → h3 → h4 heading hierarchy as nesting.
Worth reviewing carefully:
Testing
AI usage