Closed alexander-matthiesen closed 3 years ago
Unfortunately that's not possible in the current version. I like the idea though. In hindsight I would probably design it this way. But now that this would be a breaking change I have to consider whether to include it in the next major version or hide it behind an option...
An option would make sense, from my point of view. With that, a breaking change would be avoided. :)
@lukasgeiter what about extending the hide
setting that allows for targeted hiding of pages while keeping the default behavior of hiding the directory. The following suggestions allows for maintaining compatibility with the current interface while allowing for targeted hiding of specific or un-arranged pages. This could then be further expanded by adding a ...
line item to the hide
setting to change the default unspecified page behavior from "show after arranged pages" to "hide all un-arranged pages".
File structure for these suggestions are as follows:
index.md
is shown before automated arrangement of non-included.md
and bar.md
.
title: Test
arrange:
- index.md
Entire foo
directory is hidden from nav menu.
title: Test
arrange:
- index.md
hide: true
index.md
and bar.md
are included, but not-included.md
is hidden from the nav menu.
title: Test
arrange:
- index.md
hide:
- not-included.md
index.md
are included, but not-included.md
and 'bar.md` are hidden from the nav menu.
title: Test
arrange:
- index.md
hide:
- ...
If reusing the hide
setting is not desirable, a new one could be created. Maybe named exclude
.
@lukasgeiter any updates on this?
@alexander-matthiesen Sorry for the long wait. I've recently started working on this and some other features. A new release should be ready soon. I'll keep you posted.
Hi everyone! I've just released v2.3.0 which brings the nav
attribute to the .pages
file. nav
supports a few new tricks, but more importantly for this issue, it does not automatically add files that are not mentioned unless you explicitly specify a ...
entry. See the updated README for details.
Mentioning people who upvoted, so they get a notification as well: @steph-ben, @fenik17
@kleinen I went with this approach instead of extending hide
since I believe an explicit ...
entry makes things more predictable and it aligns the behavior with mkdocs' own nav
config. If anyone still has a need for a separate option to hide certain pages, please let me know (ideally by creating a new issue with your use case).
I was thinking that if we don't declare the "..." and the file into the .pages-file, the specific file won't show up after rendering. Is there a Way to just render the Files that are in the .pages-file if there isn't a "..." added to the .pages-file?
And now with dots: