docs: support multiple sidebars in a project (#11768)

* changed to new sidebar across projects except resources

* finalize multi sidebar support

* clean up

* remove redundant property

* small changes

* fixes

* generate

* fix error

* fix initial open
This commit is contained in:
Shahed Nasser
2025-03-07 15:47:38 +02:00
committed by GitHub
parent 2a0bd86204
commit 5deb8eaf50
108 changed files with 37634 additions and 36749 deletions

View File

@@ -1,9 +1,9 @@
import type { SidebarItem } from "types"
import type { Operation, PathsObject } from "@/types/openapi"
import type { OpenAPIV3 } from "openapi-types"
import dynamic from "next/dynamic"
import type { MethodLabelProps } from "@/components/MethodLabel"
import getSectionId from "./get-section-id"
import { Sidebar } from "types"
const MethodLabel = dynamic<MethodLabelProps>(
async () => import("../components/MethodLabel")
@@ -11,8 +11,8 @@ const MethodLabel = dynamic<MethodLabelProps>(
export default function getTagChildSidebarItems(
paths: PathsObject
): SidebarItem[] {
const items: SidebarItem[] = []
): Sidebar.SidebarItem[] {
const items: Sidebar.SidebarItem[] = []
Object.entries(paths).forEach(([, operations]) => {
Object.entries(operations).map(([method, operation]) => {
const definedOperation = operation as Operation