GuavaCZ/filament-knowledge-base

[Request]: Allow nav with section icons

Opened this issue · 4 comments

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?

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?

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.

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.

@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.