Skip to content

With navigation.indexes, nav doesn't recognise dirs with no other pages #3071

@jaklan

Description

@jaklan

Contribution guidelines

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

Let's say we have a following structure: docs/projects/project-name/docs. In docs folder we only have an index.md file. If we enable navigation.indexes it works as expected, but we still see an arrow on the right side, which indicates there are some pages within given section, which is not true - it's just empty.

Expected behaviour

The expected behaviour is already implemented in the mkdocs-section-index plugin - in such scenario there's no arrow on the right side.
image

Actual behaviour

image

Steps to reproduce

  1. Create docs/projects/project-name/docs dirs.
  2. Create only index.md file in the last dir.
  3. Enable navigation.indexes.
  4. Run mkdocs serve.

Package versions

  • Python: 3.8.12
  • MkDocs: 1.2.2
  • Material: 7.3.1

Configuration

site_name: Whatever

theme:
  name: material
  features:
    - navigation.tabs
    - navigation.top
    - navigation.indexes

System information

  • Operating system: macOS
  • Browser: Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions