mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-15 13:55:51 -07:00
docs: hide unfinished feature demos from sidebar
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
type: docs
|
||||
area: documentation
|
||||
|
||||
- Hid the unfinished feature demos page from the documentation sidebar while keeping its direct URL available.
|
||||
@@ -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' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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([]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user