Fix hierarchy of headers a few pages in the documentation#9909
Fix hierarchy of headers a few pages in the documentation#9909browniebroke merged 28 commits intoencode:mainfrom
Conversation
| - navigation.tracking | ||
| - search.suggest | ||
| - toc.follow | ||
| - toc.integrate |
There was a problem hiding this comment.
0e7b3ca to
98da409
Compare
98da409 to
62190a5
Compare
| hide: | ||
| - navigation |
There was a problem hiding this comment.
On the homepage, the navigation on the left has a single item and it looks weird. Hiding it to save some space.
There was a problem hiding this comment.
Pull request overview
This PR fixes a navigation rendering problem in the MkDocs documentation site caused by multiple h1 tags on several pages. Previously, with toc.integrate enabled, only the first h1 heading was used by the navigation. The fix downgrades secondary h1 headings to their proper levels throughout several documentation files, and also removes toc.integrate from the theme configuration.
Changes:
- Removed
toc.integratefrommkdocs.ymland addedhide: navigationto the index page frontmatter - Demoted multiple
# Sectionheadings to## Section(and## subsectionto### subsection) inserializers.mdto produce a single logical page root - Removed the redundant top-level
# PageTitlefromrequests.md,authentication.md, andcontent-negotiation.md, and demoted their sub-headings accordingly; retained the single# PageTitleh1 infields.mdandexceptions.mdwhile shifting their secondary headings
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
mkdocs.yml |
Removes toc.integrate feature (which caused only the first h1 to appear in navigation) |
docs/index.md |
Adds hide: navigation frontmatter to prevent the left nav sidebar on the homepage |
docs/api-guide/serializers.md |
Demotes all h1 section headings to h2 and h2 subsections to h3 throughout the file |
docs/api-guide/requests.md |
Removes the page-title # Requests h1 and demotes sub-headings |
docs/api-guide/fields.md |
Retains the single # Serializer fields h1; demotes internal # Section to ## Section and ## Item to ### Item; converts a #### Parsers and file uploads heading to a !!! note admonition |
docs/api-guide/exceptions.md |
Retains the single # Exceptions h1; demotes internal # API Reference etc. to h2 and ## Exception types to h3 |
docs/api-guide/content-negotiation.md |
Removes the page-title # Content negotiation h1 and demotes sub-headings |
docs/api-guide/authentication.md |
Removes the page-title # Authentication h1 and demotes sub-headings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
auvipy
left a comment
There was a problem hiding this comment.
the API and other option do not provide any drop down menu like before. is that intended?
What do you mean by "before"? Do you mean on the old theme? Or on the updated them, before this fix?
|


Description
As per #9908
The page has multiple
h1tags which means the navigation only renders the first one. Looks like a number of our pages have the same problem... 😞