File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change 1- import { Layout as BaseLayout } from '@rspress/core/theme' ;
1+ import {
2+ getCustomMDXComponent as BaseGetCustomMDXComponent ,
3+ Layout as BaseLayout ,
4+ } from '@rspress/core/theme' ;
25import {
36 Search as PluginAlgoliaSearch ,
47 ZH_LOCALES ,
@@ -7,6 +10,31 @@ import { NavIcon } from '@rstack-dev/doc-ui/nav-icon';
710import { HomeLayout } from './pages' ;
811import './index.scss' ;
912import { useLang } from '@rspress/core/runtime' ;
13+ import {
14+ LlmsContainer ,
15+ LlmsCopyButton ,
16+ LlmsViewOptions ,
17+ } from '@rspress/plugin-llms/runtime' ;
18+
19+ export function getCustomMDXComponent ( ) {
20+ const { h1 : H1 , ...mdxComponents } = BaseGetCustomMDXComponent ( ) ;
21+
22+ const MyH1 = ( { ...props } ) => {
23+ return (
24+ < >
25+ < H1 { ...props } />
26+ < LlmsContainer >
27+ < LlmsCopyButton />
28+ < LlmsViewOptions />
29+ </ LlmsContainer >
30+ </ >
31+ ) ;
32+ } ;
33+ return {
34+ ...mdxComponents ,
35+ h1 : MyH1 ,
36+ } ;
37+ }
1038
1139const Layout = ( ) => {
1240 return < BaseLayout beforeNavTitle = { < NavIcon /> } /> ;
You can’t perform that action at this time.
0 commit comments