Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation Path (Breadcrumbs) render bug #4865

Closed
4 tasks done
adminradio opened this issue Jan 15, 2023 · 7 comments
Closed
4 tasks done

Navigation Path (Breadcrumbs) render bug #4865

adminradio opened this issue Jan 15, 2023 · 7 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@adminradio
Copy link

Context

No response

Bug description

I’m trying the new navigation paths feature, but stumbled over a visual hickup. The following mkdocs.ymlgenerates the output in the screenshot (the red line shows the problem):

site_name: My Docs

theme:
  name: material
  features:
    - navigation.path

nav:
  - Start:
    - index.md
    - Level 1:
      - l1/index.md
      - Level 1.1: l1/l1.1/index.md

Bildschirm­foto 2023-01-15 um 17 40 40

Related links

Reproduction

example.zip

Steps to reproduce

  1. init a new mkdocs project
  2. add nested nav items with content on section item, like so:
nav:
  - Start:
    - index.md
    - Level 1:
      - l1/index.md
      - Level 1.1: l1/l1.1/index.md

Browser

No response

Before submitting

@squidfunk squidfunk added the bug Issue reports a bug label Jan 15, 2023
@wilhelmer
Copy link
Contributor

I can confirm this. The bug occurs whenever there's no topic at root level.

So this works:

nav:
  - Start: index.md # This is our root level topic
  - Level 1:
    - l1/index.md
    - Level 1.1: l1/l1.1/index.md

But this doesn't:

nav:
  - Start: # No root level topic here
    - index.md 
    - Level 1:
      - l1/index.md
      - Level 1.1: l1/l1.1/index.md

@squidfunk
Copy link
Owner

Thanks for reporting! Fixed in 4ac3eea3d 😊

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jan 16, 2023
@wilhelmer
Copy link
Contributor

wilhelmer commented Jan 16, 2023

Works, thanks!

Side note: I'd rather not have the breadcrumbs on level 1 pages at all, as in most cases, it will only duplicate the page title:

image

I changed that by wrapping path.html in {% if page.ancestors | length > 1 %}. But maybe you'll want to add that as a general option.

@squidfunk
Copy link
Owner

Good idea, this has already been proposed in #4875.

@squidfunk
Copy link
Owner

Breadcrumbs are now only shown when the depth >= 2, and can be hidden on a per-page basis (or per section, by using the built-in meta plugin). For more, see #4875 (comment)

@wilhelmer
Copy link
Contributor

... and it's live in our docs! 🚀

Really great addition to Material, thanks.

@squidfunk
Copy link
Owner

Released as part of 9.0.5-insiders-4.28.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

3 participants