Starting a new site and rolling my own theme. Came across some slightly odd behaviour.
Mkdocs version 1.0.4
Python version 3.7.1
Expected:
page.is_homepage evaluates to True on the home (index.md) of the site, and false on all other pages.
Actual:
page.is_homepage evaluates to True on the home (index.md), and on any other index.md that is included in the nav object without nesting.
Examples:
The unexpected result:
nav:
- Home: index.md <--- page.is_homepage evaluates to True
- About: about.md <--- page.is_homepage evaluates to False
- Projects: projects/index.md <--- page.is_homepage evaluates to True
Changing the filename causes it to evaluate to false:
nav:
- Home: index.md <--- page.is_homepage evaluates to True
- About: about.md <--- page.is_homepage evaluates to False
- Projects: projects/test.md <--- page.is_homepage evaluates to False
If I tweak it a bit, so that the sections are nested, then it evaluates to false as I'd expect:
nav:
- About:
- About: about.md <--- page.is_homepage evaluates to False
- Projects:
- Project home: projects/index.md <--- page.is_homepage evaluates to False
This feels like a bug - especially as simply changing the markdown file name causes the behaviour to change.
Starting a new site and rolling my own theme. Came across some slightly odd behaviour.
Mkdocs version 1.0.4
Python version 3.7.1
Expected:
page.is_homepageevaluates to True on the home (index.md) of the site, and false on all other pages.Actual:
page.is_homepageevaluates to True on the home (index.md), and on any other index.md that is included in the nav object without nesting.Examples:
The unexpected result:
Changing the filename causes it to evaluate to false:
If I tweak it a bit, so that the sections are nested, then it evaluates to false as I'd expect:
This feels like a bug - especially as simply changing the markdown file name causes the behaviour to change.