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

[Request]: Allow nav with section icons #21

Open
iAmKevinMcKee opened this issue May 10, 2024 · 4 comments
Open

[Request]: Allow nav with section icons #21

iAmKevinMcKee opened this issue May 10, 2024 · 4 comments

Comments

@iAmKevinMcKee
Copy link
Contributor

What feature would you like to add?

My app nav looks like this:

image

I would like to mirror the same nav in the docs, but right now I have to define an icon for each page instead of just one for the section. Would be great to be able to do that for the docs.

Notes

I'm not sure what the implementation would be. Right now those top level nav items are just defined by the directory structure of your docs folder. Maybe in the directory, you could have a config file, or even just load an icon.txt file there. If there is an icon.txt file there, then set that as the icon for the group and ignore any icons in the .md files?

@iAmKevinMcKee
Copy link
Contributor Author

Are there any plans to add this behavior? If I submitted a PR that add this as an option, would you be willing to accept it?

@lukas-frey
Copy link
Contributor

Hi Kevin, I'm not sure I like that approach, but since I have no better solution right now, I'd be open to accept the PR.

But I think I prefer if it was a file _settings.md or _group.md or something, where you configure it using the front matter, to keep it consistent across the package. It would also allow to customize more things in the future about the group, not just the icon.

@iAmKevinMcKee
Copy link
Contributor Author

But I think I prefer if it was a file _settings.md or _group.md or something, where you configure it using the front matter, to keep it consistent across the package. It would also allow to customize more things in the future about the group, not just the icon.

So are you thinking a _group.md file that lives in the directory, and that file only has front matter and no content? It could have an order similar to how each doc has that, and then use that to set the order of the groups?

If that's the approach, how would you want to set the icon on the group? If you have icon set here, then ignore any icons within front matter on any files in the directory? Seems to make the most sense to me but just want to be sure before I go build it.

@lukas-frey
Copy link
Contributor

@iAmKevinMcKee Yes, exactly. Except I don't think there's a need to ignore the icon set in the front matter of each documentation.

If you only want to have an icon set for the group, you only define icon in the front-matter of the group. If you only want icons for the documentation items, you define the icon property in the front-matter of the documentation and if you want to have icons for both groups and documentation items, you define it in both places.

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

No branches or pull requests

2 participants