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:
@@ -3,7 +3,7 @@
|
||||
import { createContext, useEffect } from "react"
|
||||
import { useSidebar } from "docs-ui"
|
||||
import { useArea } from "./area"
|
||||
import { SidebarItemLink } from "types"
|
||||
import { Sidebar } from "types"
|
||||
|
||||
const PageTitleContext = createContext(null)
|
||||
|
||||
@@ -27,7 +27,7 @@ const PageTitleProvider = ({ children }: PageTitleProviderProps) => {
|
||||
// find the child that matches the active path
|
||||
const item = activeItem?.children?.find(
|
||||
(i) => i.type === "link" && i.path === activePath
|
||||
) as SidebarItemLink
|
||||
) as Sidebar.SidebarItemLink
|
||||
if (item) {
|
||||
document.title = `${item.title} - ${titleSuffix}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user