-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
docs(sidebar): support docs/custom/ items and preserve hash anchors #2425
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
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for slidev failed.
|
@slidev/client
create-slidev
create-slidev-theme
@slidev/parser
@slidev/cli
@slidev/types
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the VitePress sidebar generation to support custom documentation files. The implementation adds parsing, matching, and display logic for markdown files in the docs/custom/ directory, allowing them to be referenced in feature page sidebars alongside existing guide and feature references.
Key changes:
- Added parsing for custom documentation files from
docs/custom/*.md - Extended the matching logic to recognize custom file types
- Improved link generation to properly support hash fragments in all reference types
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request updates the sidebar generation logic in
docs/.vitepress/sidebar-gen.tsto support a new category of sidebar items for custom documentation files. The changes ensure that markdown files indocs/custom/are parsed and can be referenced in the sidebar with a distinct label and icon.Sidebar generation enhancements:
docs/custom/directory and include them asParsedFileobjects for sidebar construction.'custom'.🛠️) and correct linking, alongside existing feature and guide types.Additional fix:
Fixed sidebar link generation to preserve URL fragments (hash anchors).
Previously, anything after # could be dropped, causing redirects to unintended locations.