-
Notifications
You must be signed in to change notification settings - Fork 274
/
Copy pathindex.tsx
43 lines (35 loc) · 891 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import Theme, {
Link,
PrevNextPage,
getCustomMDXComponent,
} from 'rspress/theme';
const Layout = () => <Theme.Layout />;
export default {
...Theme,
Layout,
};
const { code: Code, pre: Pre } = getCustomMDXComponent();
/* expose internal CodeBlock component */
export const CodeBlock = ({ children, language, title }) => {
return (
<Pre>
<Code
className={`language-${language}`}
meta={title ? `title="${title}"` : undefined}
>
{children}
</Code>
</Pre>
);
};
const CustomLink = (props) => (
<Link {...props} className={props.className + ' rspress-link'} />
);
/* omit rendering for edge cases */
const CustomPrevNextPage = (props) => {
if (!props.text) return null;
return <PrevNextPage {...props} />;
};
export { CustomLink as Link };
export { CustomPrevNextPage as PrevNextPage };
export * from 'rspress/theme';