Skip to content

is_homepage is False if the homepage contains subpages #3551

Open

Description

@joserebelo

Our homepage contains multiple subpages:

nav:
  - Home:
    - index.md
    - page2.md
    - page3.md

In the is_homepage property:

def is_homepage(self) -> bool:
"""Evaluates to `True` for the homepage of the site and `False` for all other pages."""
return self.is_top_level and self.is_index and self.file.url in ('.', './', 'index.html')

the page.is_top_level property is False for the homepage index page, even though it is indeed the homepage and served at root level.

Using the Material for MkDocs theme, although I don't think it's related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions