feature request: component to generate a sidebar menu
one of the harder things to get right when working with a site generator is a sidebar navigation menu. In the past I've worked with fairly proscriptive generators like Hugo and Astro's Starlight overlay, each of which helps with this, but each of which eventually proved overly constrictive. Still this is one feature I definitely miss.
My hope is that since Gracile does have a router, that its internals at build time do in fact have in memory an object that contains all routes that can be iterated. If so, then that object can be used to do one of several things, any of which would meet my needs:
* a helper function that produces a div tag containing the sidebar populated with a tree structure that I can then apply CSS to theme
* a JSON or YAML file that holds the tree structure of routes that I can read in as *I* build my site navigation. This would be more flexible than I need, because it could also be used by someone who wanted a single navigation item that might be a top nav item with menus for some screen sizes and a tray style nav item for smaller mobile devices.
* an API in the router that exposes that Iterable for me to do one of the two above things myself as the person implementing the site.
Thanks!
关闭于 2024-08-06 2 条评论