Repository: squidfunk/mkdocs-material

Issue #2125: Top-level pages aren't grouped under the first tab
Created: 2020-12-14T10:49:08Z
I've read the contribution guidelines and agree with them

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


Create a new mkdocs-material project
Add top-levels pages to the nav
Enable the feature navigation.tabs
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)

Duplicate issue #3076: Unable to add child pages on the homepage with tabs enabled
Created: 2021-10-03T16:27:12Z
Contribution guidelines

 I've read the contribution guidelines and wholeheartedly agree

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

 ... the problem doesn't occur with the mkdocs or readthedocs themes
 ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
 ... the documentation does not mention anything about my problem
 ... there are no open or closed issues that are related to my problem

Description
When creating sections with navigation.tabs enabled, sibling pages (note: not sections) to the homepage appear as tabs rather than sections for the homepage tab itself. This works as expected for any other tab. Sections yes should appear as tabs, but sole pages should appear in the sidebar.
From some basic bisecting, I know this broke in version 6.2.0, which appears to be when the implementation was rewritten anyway. Since then it has not worked.
Expected behaviour
For the homepage (index.md), if another page is created in the same directory (another-page.md), it shows up in the sidebar of the homepage.
Actual behaviour
For the homepage (index.md), if another page is created in the same directory (another-page.md), it shows up as a tab.
Note that this works as expected for all other sections.
Steps to reproduce

Create a basic mkdocs site
Attempt to add a file next to the index.md file
Build site, and observe behaviour

Package versions

Python: python --version 3.9.7
MkDocs: mkdocs --version 1.2.2
Material: pip show mkdocs-material | grep -E ^Version 7.3.1

Configuration
theme:
  name: 'material'
  icon:
    logo: fontawesome/solid/book
  favicon: 'favicon.ico'
  features:
    - navigation.tabs
    - navigation.instant
  palette:
    primary: 'blue'
    accent: 'blue'


### System information

- Operating system: Linux
- Browser: Firefox

Closing comment (2021-10-03T17:27:40Z): Thanks for reporting. This is a duplicate of #2125 and an intended change in behavior which is documented (See footnote 1.). I don't have the time to go into detail why this change was necessary, but if you read #1884, #2072 and #2125 it should be pretty clear that this change makes sense.
Also, behavior is almost identical if you regroup your pages:
#2125 (comment)