-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathmdx-components.js
More file actions
23 lines (21 loc) · 881 Bytes
/
mdx-components.js
File metadata and controls
23 lines (21 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { DocsLayout } from './src/components/docs/DocsLayout';
// Custom MDX components without nextra-theme-docs
export function useMDXComponents(components) {
return {
// Wrapper component that wraps the entire MDX content with DocsLayout
// Sidebar is now in the Next.js layout (persists across navigations)
wrapper: ({ children, toc, metadata, sourceCode, pageMap: _pageMap, filePath, projectId, ...props }) => {
return (
<DocsLayout toc={toc} metadata={metadata} filePath={filePath} projectId={projectId}>
{children}
</DocsLayout>
);
},
// You can add custom component mappings here
// Example:
// h1: (props) => <h1 className="custom-h1" {...props} />,
// h2: (props) => <h2 className="custom-h2" {...props} />,
// a: (props) => <a className="custom-link" {...props} />,
...components,
};
}