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

Top-level pages aren't grouped under the first tab #2125

Closed
5 tasks done
fveauvy opened this issue Dec 14, 2020 · 4 comments
Closed
5 tasks done

Top-level pages aren't grouped under the first tab #2125

fveauvy opened this issue Dec 14, 2020 · 4 comments
Labels
documentation Issue concerns the documentation

Comments

@fveauvy
Copy link

fveauvy commented Dec 14, 2020

I've found a bug and checked that ...

  • ... the problem doesn't occur with the default MkDocs template
  • ... the problem is not in any of my customizations (CSS, JS, template)
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Since I upgraded to mkdocs-material 6.1.7 and mkdocs-material-insiders 1.13.0, it seems that top-level pages aren't grouped under the first tab anymore when I use tab navigation.

Expected behavior

According to the navigation tabs doc, all top-level pages defined inside the nav entry of mkdocs.yml should be grouped under the first tab and should receive the title of the first page.

Actual behavior

Top level pages are defined as tabs.

Steps to reproduce the bug

  1. Create a new mkdocs-material project
  2. Add top-levels pages to the nav
  3. Enable the feature navigation.tabs
  4. Serve

Package versions

  • Python: python --version 3.7.7
  • MkDocs: mkdocs --version 1.1
  • Material: pip show mkdocs-material | grep -E ^Version 6.1.7+insiders.1.13.0

Project configuration

site_name: Test Nav
site_description: Test Nav

theme:
  name: material
  features:
    - navigation.tabs

nav:
  - Home: index.md
  - Top Level: top-level.md
  - Nav:
      - nav/second-level-1.md
      - nav/second-level-2.md

System information

  • OS: MacOS Catalina 10.15.7
  • Browser: Chrome Version 87.0.4280.88 (Build officiel) (x86_64)
@squidfunk
Copy link
Owner

squidfunk commented Dec 14, 2020

That's intended behavior for the latest Insiders release and part of the necessary navigation refactoring. I'm sorry this wasn't clear enough from the changelog. The "group under first tab" behavior seemed like a great idea at start but it led to a lot of confusion among users and doesn't allow to put single pages or links into the tabs navigation, which is why I simplified the business logic to follow a 1:1 mapping.

You should get the same layout, if you regroup your pages like this:

nav:
  - Your project name:
    - Home: index.md
    - Top Level: top-level.md
  - Nav:
      - nav/second-level-1.md
      - nav/second-level-2.md

The only thing where this deviates is that the tab is now not called "Home" anymore but "Your project name", which Material for MkDocs showed as the title of the sidebar with the old grouping behavior. The section index plugin may help to get rid of this behavior, but it may not yet work with the latest Insiders. When the goal is reached (we're only $60 away from it), I'll check how we can integrate a solution to allow index pages, which should give full flexibility again.

@squidfunk
Copy link
Owner

I'll mark this as a documentation issue, so we remember to update the documentation when Insiders is merged into master again.

@squidfunk squidfunk added the documentation Issue concerns the documentation label Dec 14, 2020
@fveauvy
Copy link
Author

fveauvy commented Dec 14, 2020

Thanks for the quick reply.
My bad, I thought it was unintended.

@squidfunk
Copy link
Owner

e07b83c added a footnote detailing that and why this behavior was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue concerns the documentation
Projects
None yet
Development

No branches or pull requests

2 participants