oprypin / mkdocs-section-index

MkDocs plugin to allow clickable sections that lead to an index page
https://oprypin.github.io/mkdocs-section-index
MIT License
77 stars 8 forks source link

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

Open solonovamax opened 3 years ago

solonovamax commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 2 years ago

+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.