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

Will use first page as "index", even if it is not named index.md or README.md #6

Open
solonovamax opened this issue Sep 7, 2021 · 4 comments

Comments

@solonovamax
Copy link

Currently, the first page will be set as the "index page", even if the name doesn't match index.md or README.md.

This is quite annoying, as it requires me to make an index.md page for every single folder to avoid ""losing"" pages.

@oprypin
Copy link
Owner

oprypin commented Sep 7, 2021

The endorsed way to avoid pages being picked up for the index is specifying their title (not only file name) when writing the nav.

In the example you can see that I chose to omit the title only for the index page.

I thought that would be good enough, but perhaps not for everyone. Personally I use mkdocs-literate-nav with this (as described here) so it's impossible to omit titles. So perhaps I misjudged this.

#5 would indeed be an alternative, as you noticed.

@solonovamax
Copy link
Author

@oprypin I was using mkdocs-literate-nav as well, but I didn't bother to fully specify every single sub element. I only specified some of the top level ones who's names I wanted to change.

@rkk1995
Copy link

rkk1995 commented Sep 20, 2021

What if we are not using nav? I have alot of files so I just let MKDocs pickup on the directory structure.

ex ) https://github.com/rkk1995/Notes/blob/mainline/mkdocs.yml

Is tehre a way I can specify index pages for only some directories?

@jaklan
Copy link

jaklan commented Nov 4, 2021

+1 on that, I definitely prefer the behaviour presented in mkdocs-material, where all pages other than README.md / index.md are treated as "normal" pages, not indexes. As @rkk1995 mentioned - probably most people auto-generate nav with pure mkdocs or with mkdocs-awesome-pages for complex structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants