vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Enable SidebarItem only menu in sidebar

Open benmccann opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe.

Chart.js has a mix of expandable groups and individual items within its sidebar. I can't migrate the docs from Vuepress to Vitepress because Vitepress will not allow individual items within the sidebar

Describe the solution you'd like

The types are currently:

  export type Sidebar = SidebarGroup[] | SidebarMulti

  export interface SidebarMulti {
    [path: string]: SidebarGroup[]
  }

It would be nice to change them to:

  export type Sidebar = Array<SidebarGroup|SidebarItem> | SidebarMulti

  export interface SidebarMulti {
    [path: string]: Array<SidebarGroup|SidebarItem>
  }

Describe alternatives you've considered

Make a group with just an individual item in it. It's kind of an annoying user experience though

Additional context

The work-in-progress branch is here: https://github.com/benmccann/Chart.js/tree/vitepress

Validations

benmccann avatar Aug 22 '22 22:08 benmccann

This config is tied to Default Theme. If Default Theme does not support this type of structure, it shouldn't have it. If you need custom type, that means you should create your own config types 👍

If VitePress default theme gets support for this type of sidebar structure, then it will be modified as you mentioned. And actually this feature is planned.

kiaking avatar Aug 23 '22 00:08 kiaking

Given that the feature is planned, maybe it'd make sense to leave this open to track it? It'd be easier for folks who are interested to subscribe to this thread and be notified when it's closed than having to come back on a frequent basis to check the release notes to see whether it's been implemented

benmccann avatar Aug 23 '22 02:08 benmccann

Make sense. I'll adjust the title then 👍

kiaking avatar Aug 23 '22 03:08 kiaking

It's supported now. Support for this was added some time in the last year IG.

brc-dd avatar Aug 05 '23 18:08 brc-dd