Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion website/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Layout as BaseLayout } from '@rspress/core/theme';
import {
Layout as BaseLayout,
getCustomMDXComponent as basicGetCustomMDXComponent,
} from '@rspress/core/theme';
import {
Search as PluginAlgoliaSearch,
ZH_LOCALES,
Expand All @@ -7,6 +10,31 @@ import { NavIcon } from '@rstack-dev/doc-ui/nav-icon';
import { HomeLayout } from './pages';
import './index.scss';
import { useLang } from '@rspress/core/runtime';
import {
LlmsContainer,
LlmsCopyButton,
LlmsViewOptions,
} from '@rspress/plugin-llms/runtime';

export function getCustomMDXComponent() {
const { h1: H1, ...mdxComponents } = basicGetCustomMDXComponent();

const MyH1 = ({ ...props }) => {
return (
<>
<H1 {...props} />
<LlmsContainer>
<LlmsCopyButton />
<LlmsViewOptions />
</LlmsContainer>
</>
);
};
return {
...mdxComponents,
h1: MyH1,
};
}

const Layout = () => {
return <BaseLayout beforeNavTitle={<NavIcon />} />;
Expand Down
Loading