docs: hide unfinished feature demos from sidebar

This commit is contained in:
2026-08-14 21:50:08 -07:00
parent b98d4d65c7
commit 8ddc151435
3 changed files with 9 additions and 3 deletions
+4
View File
@@ -0,0 +1,4 @@
type: docs
area: documentation
- Hid the unfinished feature demos page from the documentation sidebar while keeping its direct URL available.
-1
View File
@@ -306,7 +306,6 @@ const sidebar: DefaultTheme.SidebarItem[] = [
{ text: 'Usage', link: '/usage' },
{ text: 'Mining Workflow', link: '/mining-workflow' },
{ text: 'Launcher Script', link: '/launcher-script' },
{ text: 'Feature Demos', link: '/demos' },
],
},
{
+5 -2
View File
@@ -21,6 +21,7 @@ function slugify(heading: string): string {
}
const EXCLUDED_PAGES = new Set(['README.md']);
const UNLISTED_ROUTES = new Set(['/demos']);
const PUBLIC_PREFIXES = ['/assets/', '/screenshots/', '/config.example.jsonc', '/favicon'];
function loadPages(): Map<string, string> {
@@ -114,7 +115,7 @@ test('slugify matches the VitePress cases these docs actually rely on', () => {
expect(slugify('2. Install SubMiner')).toBe('_2-install-subminer');
});
test('every docs page is reachable from the sidebar', async () => {
test('every docs page is reachable from the sidebar unless explicitly unlisted', async () => {
const { default: config } = await import('./.vitepress/config');
const sidebar = config.themeConfig?.sidebar as Array<{
items?: Array<{ text: string; link?: string }>;
@@ -127,6 +128,8 @@ test('every docs page is reachable from the sidebar', async () => {
}
}
const orphans = [...pages.keys()].filter((route) => !linked.has(route));
const orphans = [...pages.keys()].filter(
(route) => !linked.has(route) && !UNLISTED_ROUTES.has(route),
);
expect(orphans).toEqual([]);
});