mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-27 21:48:41 +02:00
fix(plugin-docs,theme): refactor docs plugin routes and component tree (#7966)
This commit is contained in:
parent
c29218ea1d
commit
3b9b497d13
35 changed files with 1189 additions and 857 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import {createDocsByIdIndex} from './docs';
|
||||
import type {VersionTag} from './types';
|
||||
import type {VersionTag, VersionTags} from './types';
|
||||
import type {
|
||||
SidebarItemDoc,
|
||||
SidebarItem,
|
||||
|
@ -21,6 +21,7 @@ import type {
|
|||
PropSidebarItemCategory,
|
||||
PropTagDocList,
|
||||
PropTagDocListDoc,
|
||||
PropTagsListPage,
|
||||
PropSidebarItemLink,
|
||||
PropVersionDocs,
|
||||
DocMetadata,
|
||||
|
@ -181,3 +182,13 @@ export function toTagDocListProp({
|
|||
items: toDocListProp(),
|
||||
};
|
||||
}
|
||||
|
||||
export function toTagsListTagsProp(
|
||||
versionTags: VersionTags,
|
||||
): PropTagsListPage['tags'] {
|
||||
return Object.values(versionTags).map((tagValue) => ({
|
||||
label: tagValue.label,
|
||||
permalink: tagValue.permalink,
|
||||
count: tagValue.docIds.length,
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue