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' ;
2
5
import {
3
6
Search as PluginAlgoliaSearch ,
4
7
ZH_LOCALES ,
@@ -7,6 +10,31 @@ import { NavIcon } from '@rstack-dev/doc-ui/nav-icon';
7
10
import { HomeLayout } from './pages' ;
8
11
import './index.scss' ;
9
12
import { 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
+ }
10
38
11
39
const Layout = ( ) => {
12
40
return < BaseLayout beforeNavTitle = { < NavIcon /> } /> ;
You can’t perform that action at this time.
0 commit comments