Open jannschu opened 3 years ago
Just saw you comments after my last push, I'm on it :)
I addressed your comments, but I have the feeling that previous_page
is now wrong if index_page
does not pick the first child. I'll add a test case to be sure.
Oh wow that's a lot of logic now :(
Do you think anyone will actually need the ability to pick index pages from the middle?
The option could just require it to be index.md
. Doesn't that completely cover your use case?
Oh wow that's a lot of logic now :( Do you think anyone will actually need the ability to pick index pages from the middle? The option could just require it to be
index.md
. Doesn't that completely cover your use case?
Actually index.md
would be more than enough for me. So I'm fine with restricting it to that, but the logic is basically "fix a doubly linked list".
I'd even argue that if there is no index.md the first page should not become the section page by default since it then depends on alphabetical order but there might be use cases for that.
I'd even argue that if there is no index.md the first page should not become the section page by default since it then depends on alphabetical order but there might be use cases for that.
Right-- I was thinking that too, but I forgot after seeing your code because it looked totally reasonable :)
Well, if you search for existing usages, people sometimes intentionally use non-index
-named pages as the index, but the prerequisite is that their nav is specified manually.
I could make this the default only if the nav is not specified manually, but implementing that is dubious and also I think it's super rare that people just leave their nav alphabetically sorted.
So this should remain just an option.
And sorry but I think we should not keep the logic to reorder the pages. It should still be required to be first.
Just thougth about the case where a previous plugin might have reordered items such that index.md
is no longer first. This could lead to unexpected results if we just check if the first child is index.md
with that option. But we could omit a warning in such a case, but actually moving these element in a doubly linked list seems rather clean to me. But it's on you of course, just my final thoughts on this.
By the way if a plugin reorders children after this plugin results are most likely wrong. We could also omit a warning maybe if popular plugins which could do that are behind this plugin.
The warning is there
Though it doesn't detect subtle reorderings. But I think it's not unreasonable to expect the plugins to coexist anyway. Currently all mav reordering plugins I know rewrite the whole nav.
What's the status on this? Because it fixes #6, which is a very annoying issue for me.
Hmm the status is that I'm a bad human. I didn't follow up on this. The feature is needed, but I wasn't sure how exactly it should look like.
The option allows to use a different page for the section page instead of the first child.