Skip to content

Sidebar Titles Demo ​

This folder exists to show Auto Sidebar's title options on this site's real sidebar. Its pages are left untitled in .sidebar, so each title in the sidebar is one the plugin worked out:

txt
# The demo pages are left untitled here, so each sidebar title is one the
# new title options produce. Only the link below sets its own title, quoted
# after a space.
index.md
github-actions-setup.md
guide-to-the-cli.md
draft-notes.md
example-renamed-page.md
https://vitepress.dev: 'VitePress docs'

This site passes these options:

ts
generateSidebar(docsRoot, {
  titleReplacements: { github: 'GitHub' },
  transformTitle: (title, { source }) =>
    source === 'page' ? title.replace(/^Example: /, '') : undefined,
  groupTitleFromIndex: true,
});
In the sidebarWhere it comes from
Sidebar Titles Demo, the group labelThis page's title, with groupTitleFromIndex. The folder is titles-demo, and its parent .sidebar doesn't name it, so without the option the label would be "Titles Demo".
GitHub Actions SetupThe file name github-actions-setup.md, since the page has no title or # Heading. titleReplacements turns "Github" into "GitHub".
Guide to the CliThe file name guide-to-the-cli.md. titleCase (on by default) keeps "to" and "the" lowercase mid-title.
Draft notesThe page's heading, # Draft notes ((tag|draft|orange)). stripTags (on by default) removes the tag from the sidebar, and the page still shows the badge.
Renamed pageThe page's heading, # Example: Renamed page. transformTitle removes the "Example: " prefix from page titles.
VitePress docsThe .sidebar line https://vitepress.dev: 'VitePress docs'. A single-quoted title after a space works, and so does a double-quoted one. A line that can't be parsed logs a warning naming the file and line instead.

Code released under the MIT License. BinaryNoir name and logos are trademarks of BinaryNoir. Legal · Terms · Privacy