docs: redesign table of content (#12647)
* implement toc * added to projects * fixes and adapt for references * added product frontmatter * remove action menu from 404 pages
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"use client"
|
||||
|
||||
import React, { useEffect } from "react"
|
||||
import { FrontMatter, ToCItem } from "types"
|
||||
import { useSiteConfig } from "../../providers"
|
||||
|
||||
type InjectedMDXDataProps = {
|
||||
frontmatter: FrontMatter
|
||||
toc: ToCItem[]
|
||||
}
|
||||
|
||||
/**
|
||||
* This component is injected by a recma plugin into MDX documents.
|
||||
*/
|
||||
export const InjectedMDXData = ({ frontmatter, toc }: InjectedMDXDataProps) => {
|
||||
const { setFrontmatter, setToc } = useSiteConfig()
|
||||
|
||||
useEffect(() => {
|
||||
setFrontmatter(frontmatter)
|
||||
}, [frontmatter])
|
||||
|
||||
useEffect(() => {
|
||||
setToc(toc)
|
||||
}, [toc])
|
||||
|
||||
return <></>
|
||||
}
|
||||
Reference in New Issue
Block a user