When the nav
section is added to mkdocs.yml
, the rendering of the navigation.path
is broken
#8198
Unanswered
milovanovicdusan
asked this question in
Q&A
Replies: 1 comment 13 replies
-
Could be a bug, could be misconfiguration. As mentioned earlier, we need a proper bug report with a minimal reproduction. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
After successfully installing the latest Material for MkDocs Insiders version, I configured the breadcrumbs navigation by specifying the
navigation.path
feature in themkdocs.yml
file. The breadcrumbs navigation was successfully rendered above the title of each page, as expected (see an example page below):After that, I configured site navigation by specifying the
nav
section in the samemkdocs.yml
file. Then, surprisingly, the breadcrumbs navigation got rendered differently (see example on the same page as above):As you can see from the two snapshots above, the difference in rendering of the breadcrumbs navigation , before and after adding the
nav
section, is as follows:BEFORE
nav
was added: rendering of the whole navigation path, starting with the home page (named hereAssociation Episteme
), ending with the name of the menu item pointing to the current (opened) page (Open Source Intelligence
)AFTER
nav
was added: rendering of only part of the path, omitting the home page and the current (opened) pageOn further testing the functionality of rendering the breadcrumbs navigation before and after adding the
nav
section to themkdocs.yml
, I discovered that partial rendering only works for the pages belonging to second-level menu items that have children menu items/pages and for their third- and fourth-level children menu items. Furthermore, the path is not rendered fully compared to the rendering before addingnav
section - the home page (Association Episteme
in the snapshot below) and the current (opened) page are omitted.The following snapshots probably best illustrate how the rendering of the breadcrumbs navigation works when the
nav
section is included in themkdocs.yml
:No rendering of the breadcrumbs navigation for pages associated with the first-level menu item:

No rendering of the breadcrumbs navigation for pages associated with those second-level menu items that have no children (third-level) menu items:

Rendering only part of the breadcrumbs navigation path for pages associated with those second-level menu items that have children (third-level) menu items:

Rendering only part of the breadcrumbs navigation path for pages associated with the third-level menu items:

Is this an issue to be reported or an expected functionality for which I could not find any trace in the latest Material for MkDocs documentation or on the Web? The
nav
section, maintained by MkDocs, and breadcrumbs, maintained by Material for MkDocs, are handy for many reasons. It would be great if both worked as they should when used together.Workaround
I found a dirty workaround to keep full rendering of the breadcrumbs path and organise menu items from left to right and up to down in the top and left navigation menus, respectively. I am using leading spaces in the names of the
docs/
subdirectories to have them sorted not by name, as is the MkDocs default, but as I need them to appear on the web pages. That resulted in an ugly web address, where the leading spaces are URL-encoded as%20
.Beta Was this translation helpful? Give feedback.
All reactions