diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx new file mode 100644 index 0000000..0970bab --- /dev/null +++ b/src/theme/DocItem/Layout/index.tsx @@ -0,0 +1,35 @@ +import React, {type ReactNode} from 'react'; +import Layout from '@theme-original/DocItem/Layout'; +import type LayoutType from '@theme/DocItem/Layout'; +import type {WrapperProps} from '@docusaurus/types'; +import {useDoc} from '@docusaurus/plugin-content-docs/client'; + +type Props = WrapperProps; + +export default function LayoutWrapper(props: Props): ReactNode { + const {frontMatter} = useDoc(); + const image = (frontMatter as any).image as string | undefined; + + return ( + <> + {image && ( +
+ +
+ )} + + + ); +}