Skip to content

Commit

Permalink
fix: Generate namespaces into own directory to fix sidebar category
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jul 14, 2021
1 parent 19240ec commit bd7669e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/docusaurus-plugin-typedoc/src/theme.ts
@@ -1,3 +1,4 @@
import { ReflectionKind } from 'typedoc';
import MarkdownTheme from 'typedoc-plugin-markdown/dist/theme';
import { Renderer } from 'typedoc/dist/lib/output/renderer';

Expand All @@ -12,4 +13,16 @@ export default class DocusaurusTheme extends MarkdownTheme {
allowedDirectoryListings() {
return [...super.allowedDirectoryListings(), ...['_category_.yml']];
}

get mappings() {
return super.mappings.map((mapping) => {
if (mapping.kind.includes(ReflectionKind.Namespace)) {
return {
...mapping,
directory: 'namespaces',
};
}
return mapping;
});
}
}

0 comments on commit bd7669e

Please sign in to comment.