Skip to content

Auto-sidebar mode #1737

@KraXen72

Description

@KraXen72

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

Currently, the sidebar has to be manually kept in-sync with the markdown folders. this offers great control, but is annoying, if i just want the sidebar to always reflect my folders with the files in them

Describe the solution you'd like

a mode/flag on the sidebar where it would automatically generate depending on all the md files.
example folder structure:
image
example (desired sidebar):
image

i'd suggest, by default it takes all top level folders => categories and top level .md files in the folders => subheaders.
there could also be an option to specify a map/filter pass, for example to convert filenames separated with - to titles separated with space.

Describe alternatives you've considered

currently, i solved this by writing a generator script, but this is a thing many people would expect to be present by default, if the framework/ssg offers a sidebar.

my script: https://github.com/KraXen72/tech-support-wiki/blob/master/sidebar-generator.js

Additional context

it was a pain trying to figure out for half an hour that vitepress does not indeed support automatic sidebar.
also, it would be great to make it clearer that the .vitepress folder has to be inside of docs, struggled with that aswell

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions