Merge branch 'main' into ozaki/execa

This commit is contained in:
sebastien 2024-08-09 11:57:27 +02:00
commit 6c4a1d7891
147 changed files with 5409 additions and 981 deletions

View file

@ -217,6 +217,7 @@ exports[`DefaultSidebarItemsGenerator uses explicit link over the index/readme.{
{
"collapsed": undefined,
"collapsible": undefined,
"description": "Category description",
"items": [
{
"id": "parent/doc2",

View file

@ -331,6 +331,7 @@ describe('DefaultSidebarItemsGenerator', () => {
categoriesMetadata: {
Category: {
label: 'Category label',
description: 'Category description',
link: {
type: 'doc',
id: 'doc3', // Using a "local doc id" ("doc1" instead of "parent/doc1") on purpose

View file

@ -282,6 +282,7 @@ describe('validateCategoryMetadataFile', () => {
const content: CategoryMetadataFile = {
className: 'className',
label: 'Category Label',
description: 'Category Description',
link: {
type: 'generated-index',
slug: 'slug',

View file

@ -249,6 +249,9 @@ Available doc IDs:
...(customProps !== undefined && {customProps}),
...(className !== undefined && {className}),
items,
...(categoryMetadata?.description && {
description: categoryMetadata?.description,
}),
...(link && {link}),
};
}

View file

@ -64,6 +64,7 @@ function postProcessSidebarItem(
.map((subItem) => postProcessSidebarItem(subItem, params))
.filter((v): v is SidebarItem => Boolean(v)),
};
// If the current category doesn't have subitems, we render a normal link
// instead.
if (category.items.length === 0) {

View file

@ -217,6 +217,7 @@ export type PropSidebarBreadcrumbsItem =
export type CategoryMetadataFile = {
label?: string;
position?: number;
description?: string;
collapsed?: boolean;
collapsible?: boolean;
className?: string;

View file

@ -167,6 +167,7 @@ export function validateSidebars(sidebars: {
const categoryMetadataFileSchema = Joi.object<CategoryMetadataFile>({
label: Joi.string(),
description: Joi.string(),
position: Joi.number(),
collapsed: Joi.boolean(),
collapsible: Joi.boolean(),