Skip to content

Commit e40d71e

Browse files
fix: display "On this page" TOC aside on (root) docs (currently missing)
1 parent ffd91ad commit e40d71e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/lib/snippet-toc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ export async function getSnippetTOCForPage(slug?: string[]): Promise<any[]> {
4242
if (!slug) return [];
4343

4444
const possiblePaths = [
45+
// Standard locations
4546
path.join(process.cwd(), 'content/docs', ...slug, 'index.mdx'),
4647
path.join(process.cwd(), 'content/docs', ...slug) + '.mdx',
48+
// Root-collection locations (e.g. content/docs/(root)/page.mdx)
49+
path.join(process.cwd(), 'content/docs', '(root)', ...slug, 'index.mdx'),
50+
path.join(process.cwd(), 'content/docs', '(root)', ...slug) + '.mdx',
4751
];
4852

4953
for (const filePath of possiblePaths) {

0 commit comments

Comments
 (0)