docs: generate sidebar for main docs (#11139)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-01-24 19:20:02 +02:00
1 parent 8038a917ee
commit f803157943
6 files changed
+1588 -604

No files matched your search

+4 -22
View File
@@ -1,26 +1,8 @@
import { Badge } from "docs-ui"
import type { SidebarConfig, SidebarItem } from "@/types"
import { sidebar } from "../sidebar.mjs"
const soonBadge = <Badge variant="blue">Soon</Badge>
const normalizeSidebarItems = (items: SidebarItem[]) =>
items.map((item) => {
if (item.type === "separator") {
return item
}
if (item.isSoon) {
item.additionalElms = soonBadge
}
if (item.children) {
item.children = normalizeSidebarItems(item.children as SidebarItem[])
}
return item
})
import type { SidebarConfig } from "@/types"
import { generatedSidebar } from "../generated/sidebar.mjs"
import { SidebarItem } from "types"
export const sidebarConfig: SidebarConfig = {
default: normalizeSidebarItems(sidebar),
default: generatedSidebar as SidebarItem[],
mobile: [],
}