-
Notifications
You must be signed in to change notification settings - Fork 38
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
Is it possible to hide a single file from nav? #102
Comments
Not really. The regex might be able to do the trick, but it's not what it was designed for. Can you describe your use-case for hiding a single file? |
I have some extra documents as supplementary readings, they do not and should not belong to the docs of my project. I only want to reference them from a Markdown file using the Markdown link syntax I might hide more files and expect a mechanism that works in the similar way as |
@madjxatw nav:
- ... | home/** # first in the nav order is the 'Home' tab
- ... | regex=^(?!index\.md$).* # then, all paths that are not exactly "index.md" of the root But for your use-case, why can't you put all the files you want to hide into a directory and then just hide this directory? |
@VladimirFokow, it sounds a good workaround to have a dedicated directory if there is no other better way, thanks! |
@lukasgeiter , another use case is when blog pattern is enabled, a |
@madjxatw , as far as I understand, you specify plugins:
- tags:
tags_file: tags.md only once - in If you want to exclude this page from nav - also put it into that hidden folder? |
@VladimirFokow , I am currently using dedicated directories as you suggested for what to be hidden in nav. My site has a complex directory structure, so I create a "hidden" folder in each subdirectory (section) as needed for better organization and managment. Really appreciate your suggestion and awesome-pages plugin! BTW, I still kind of expect that MkDocs itself offers a feature similar to |
Thanks for helping out @VladimirFokow! Indeed, at the moment a hidden folder is the easiest solution. I've been playing with the thought of adding exclude patterns before, so it's good to know that there's a need for that 👍 |
Just came here for the same reason. I like the suggestion earlier with the special char like ! or so. My use case is that I have some external links pointing to something inside my docs where I want to show a special "not here anymore look elsehwere" page, but I don't want that page to be visible at all in the navigation. Since I do not have control over those external links I cannot use the directory trick described. |
@PlasmaHH nav:
- Home:
- ... | index.md
# The not_here_anymore.md file is not included
- dir_section Just extract a specific file from the If you're looking for a more automated approach perhaps you could modify our hook from here that uses |
The redirect thing is really not an issue for me, there is nothing to redirect to. I am unsure at what your To make it clearer, this is similar to how it looks like:
And in the end result I would like to have a simple entry in that |
@PlasmaHH You can use regex in the pattern matching, and regex allows for excluding values via the look ahead.
Here is a working example using the example above: Though, if the file should be truly |
I see that
hide: true
could hide a directory from the navigation, but is there any simple way to hide a single file? Theregex
syntax might be used to filter out a file with a specific name, but I couldn't find an example. Please advice, thanks.The text was updated successfully, but these errors were encountered: