chore(plugin-docs): remove legacy versioned prefix on doc ids and sidebar names in versioned sidebars (#9310)

This commit is contained in:
Sébastien Lorber 2023-09-15 18:52:42 +02:00 committed by GitHub
parent f5ae537d3e
commit 598b32011f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 264 additions and 396 deletions

View file

@ -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,