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
+4 -4
View File
@@ -1,8 +1,8 @@
import { MetadataRoute } from "next"
import { docsConfig } from "@/config/docs"
import { sidebars } from "@/config/sidebar"
import { absoluteUrl } from "@/lib/absolute-url"
import { SidebarItem } from "types"
import { Sidebar } from "types"
export default function sitemap(): MetadataRoute.Sitemap {
const now = new Date()
@@ -12,7 +12,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
lastModified?: string | Date
}> = []
function pushItems(newItems: SidebarItem[]) {
function pushItems(newItems: Sidebar.SidebarItem[]) {
newItems.forEach((item) => {
if (item.type !== "link") {
return
@@ -29,7 +29,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
})
}
pushItems(docsConfig.sidebar.default)
sidebars.forEach((sidebar) => pushItems(sidebar.items))
return items
}
+1 -8
View File
@@ -60,14 +60,7 @@ export default function RootLayout({
htmlClassName={clsx(inter.variable, robotoMono.variable)}
gaId={process.env.NEXT_PUBLIC_GA_ID}
>
<TightLayout
sidebarProps={{
expandItems: true,
}}
ProvidersComponent={Providers}
>
{children}
</TightLayout>
<TightLayout ProvidersComponent={Providers}>{children}</TightLayout>
</BareboneLayout>
)
}