Skip to content

Conversation

@toreis-up
Copy link
Member

@toreis-up toreis-up commented Jan 7, 2026

This pull request updates the sidebar generation logic in docs/.vitepress/sidebar-gen.ts to support a new category of sidebar items for custom documentation files. The changes ensure that markdown files in docs/custom/ are parsed and can be referenced in the sidebar with a distinct label and icon.

Sidebar generation enhancements:

  • Added logic to parse all markdown files in the docs/custom/ directory and include them as ParsedFile objects for sidebar construction.
  • Updated the sidebar item matching logic to recognize and handle custom documentation files, returning them as items of type 'custom'.
  • Added display support for custom sidebar items, including a new icon (🛠️) 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.

Copilot AI review requested due to automatic review settings January 7, 2026 15:28
@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for slidev failed.

Name Link
🔨 Latest commit f3c9876
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/6966119ee7f2ba00083f112a

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 7, 2026

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/client@2425

create-slidev

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev@2425

create-slidev-theme

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev-theme@2425

@slidev/parser

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/parser@2425

@slidev/cli

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/cli@2425

@slidev/types

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/types@2425

commit: f3c9876

@toreis-up toreis-up changed the title docs: add custom🛠️ docs support to VitePress sidebar generation docs(sidebar): support docs/custom/ items and preserve hash anchors Jan 7, 2026
Copy link
Contributor

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant