Skip to content

Breadcrumbs lost when hiding or flattening deeper nav levels #139

Description

@kendralockard

Context

Hi! I'm working on migrating a MkDocs project from awesome-pages to awesome-nav, and I’m running into an issue with breadcrumbs (enabled by the navigation.path feature from MkDocs).

In our old setup with awesome-pages, we could use flattening, e.g. ... | flat | folder/*/README.md to show only top-level and first-level pages in the sidebar, while still preserving the full internal hierarchy so breadcrumbs would display correctly.

Example of what used to work:

nav:
  - Folder:
      - Folder/README.md
      - ... | flat | Folder/*/README.md

This gave us:

  • A flat sidebar, only showing top level and one level deep READMEs
    • Each folder had many more deeply nested subfolders/pages, but they did not appear in the sidebar (as intended)
  • Breadcrumb navigation that worked for deeply nested pages

Now with awesome-nav, I’m trying something like:

nav:
  - Folder:
      - Folder/README.md
      - glob: Folder/*/README.md
        flat: true

and also tried:

      - glob: Folder/**/README.md
        hidden: true

as well as a bunch of other things, but no matter what I try, breadcrumbs don’t show because it seems awesome-nav only includes what’s explicitly matched in the nav section and it doesn’t preserve the deeper hierarchy.

Question

Is there currently any way (or planned feature) to preserve the full directory hierarchy for breadcrumb generation, while only displaying top-level and 1-level-deep pages in the sidebar? This may already be possible with awesome-nav's support for glob and deep glob patterns and I just don't understand how to do it?

Or, if this is not currently possible, is there any possibility that awesome-nav could include an option to recursively scan the directory and then apply visibility/flattening rules without removing those items from the internal nav tree?

Thanks for the awesome plugin, it’s been very useful and enabled a lot of excellent features for our MkDocs project!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions