Jelajahi Sumber

chore: Fix docgen path handling

Michael Bromley 2 tahun lalu
induk
melakukan
73fce94bf1
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      scripts/docs/typescript-docs-parser.ts

+ 2 - 1
scripts/docs/typescript-docs-parser.ts

@@ -55,7 +55,8 @@ export class TypescriptDocsParser {
                     existingPage.declarations.push(declaration);
                     existingPage.declarations.push(declaration);
                 } else {
                 } else {
                     const normalizedTitle = this.kebabCase(pageTitle);
                     const normalizedTitle = this.kebabCase(pageTitle);
-                    const fileName = normalizedTitle === declaration.category ? '_index' : normalizedTitle;
+                    const categoryLastPart = declaration.category.split('/').pop();
+                    const fileName = normalizedTitle === categoryLastPart ? '_index' : normalizedTitle;
                     pages.set(pageTitle, {
                     pages.set(pageTitle, {
                         title: pageTitle,
                         title: pageTitle,
                         category: declaration.category.split('/'),
                         category: declaration.category.split('/'),