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

is_homepage is False if the homepage contains subpages #3551

Open
joserebelo opened this issue Jan 16, 2024 · 0 comments
Open

is_homepage is False if the homepage contains subpages #3551

joserebelo opened this issue Jan 16, 2024 · 0 comments

Comments

@joserebelo
Copy link

joserebelo commented Jan 16, 2024

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
Projects
None yet
Development

No branches or pull requests

2 participants