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

Hide entire menu with an hide-menu: true setting in .pages file #23

Closed
kleinen opened this issue Apr 27, 2020 · 6 comments
Closed

Hide entire menu with an hide-menu: true setting in .pages file #23

kleinen opened this issue Apr 27, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@kleinen
Copy link

kleinen commented Apr 27, 2020

My group has some theme overrides setup to not render the entire nav menu of our main index page since we want the main page to be clean and the other pages are more "utility" in nature. It would be nice if this were built-in and we didn't need the custom theme work.

It feels like this functionality best fits with this plugin, hence why this enhancement suggestion was created.

@lukasgeiter lukasgeiter added the enhancement New feature or request label Apr 27, 2020
@lukasgeiter
Copy link
Owner

I'm not sure if I fully understand your request. Would this be different than setting hide: true in the .pages file of the parent folder?

@kleinen
Copy link
Author

kleinen commented Apr 27, 2020

Well there you go being awesome. I hadn't thought of that. I'll give it a try.

@kleinen
Copy link
Author

kleinen commented Apr 27, 2020

No luck. I get an warning. I think it has to do with the menu I'm hiding being the root page menu.

[I 200427 18:28:34 watcher:103] Running task: builder (delay: None)
INFO    -  Running task: builder (delay: None)
INFO    -  Building documentation... 
/usr/local/lib/python3.8/site-packages/mkdocs_awesome_pages_plugin/navigation.py:48: HideInRootHasNoEffect: Using the "hide" attribute in the .pages file of the doc root has no effect
  warnings.warn(HideInRootHasNoEffect(self.options.filename))

@lukasgeiter
Copy link
Owner

Do you want to hide the navigation for all pages or only when the root page is selected?

@kleinen
Copy link
Author

kleinen commented Apr 27, 2020

Only when the root page is selected. Now that I type that, maybe this plugin is not the place for that and it would best be something added directly into mkdocs-material or its own extension/plugin.

Do you think this would be something that would be covered through this plugin?

@lukasgeiter
Copy link
Owner

I think you're probably right. This plugin currently only hooks into the on_nav event which is only called once for the entire build. I'm not even sure if it would be possible to change the navigation based on the selected page using a mkdocs plugin.

As far as I can tell, the right place to implement such a feature would be the theme.

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

No branches or pull requests

2 participants