mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
chore(plugin-docs): remove legacy versioned prefix on doc ids and sidebar names in versioned sidebars (#9310)
This commit is contained in:
parent
f5ae537d3e
commit
598b32011f
25 changed files with 264 additions and 396 deletions
|
@ -35,10 +35,11 @@ export function toSidebarDocItemLinkProp({
|
|||
item: SidebarItemDoc;
|
||||
doc: Pick<
|
||||
DocMetadata,
|
||||
'id' | 'title' | 'permalink' | 'unlisted' | 'frontMatter' | 'unversionedId'
|
||||
'id' | 'title' | 'permalink' | 'unlisted' | 'frontMatter'
|
||||
>;
|
||||
}): PropSidebarItemLink {
|
||||
const {
|
||||
id,
|
||||
title,
|
||||
permalink,
|
||||
frontMatter: {
|
||||
|
@ -46,7 +47,6 @@ export function toSidebarDocItemLinkProp({
|
|||
sidebar_custom_props: customProps,
|
||||
},
|
||||
unlisted,
|
||||
unversionedId,
|
||||
} = doc;
|
||||
return {
|
||||
type: 'link',
|
||||
|
@ -54,7 +54,7 @@ export function toSidebarDocItemLinkProp({
|
|||
href: permalink,
|
||||
className: item.className,
|
||||
customProps: item.customProps ?? customProps,
|
||||
docId: unversionedId,
|
||||
docId: id,
|
||||
unlisted,
|
||||
};
|
||||
}
|
||||
|
@ -151,9 +151,9 @@ Available document ids are:
|
|||
function toVersionDocsProp(loadedVersion: LoadedVersion): PropVersionDocs {
|
||||
return Object.fromEntries(
|
||||
loadedVersion.docs.map((doc) => [
|
||||
doc.unversionedId,
|
||||
doc.id,
|
||||
{
|
||||
id: doc.unversionedId,
|
||||
id: doc.id,
|
||||
title: doc.title,
|
||||
description: doc.description,
|
||||
sidebar: doc.sidebar,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue