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
@@ -1,12 +1,11 @@
import path from "path"
import type { Transformer } from "unified"
import type { RawSidebarItem } from "types"
import type { UnistTree } from "types"
import type { Sidebar, UnistTree } from "types"
export function pageNumberRehypePlugin({
sidebar,
}: {
sidebar: RawSidebarItem[]
sidebar: Sidebar.RawSidebarItem[]
}): Transformer {
return async (tree, file) => {
const { valueToEstree } = await import("estree-util-value-to-estree")
@@ -66,9 +65,9 @@ export function pageNumberRehypePlugin({
}
function findSidebarItem(
sidebar: RawSidebarItem[],
sidebar: Sidebar.RawSidebarItem[],
path: string
): RawSidebarItem | undefined {
): Sidebar.RawSidebarItem | undefined {
let foundItem = undefined
for (const item of sidebar) {
if (item.type === "separator") {