From be647e96d2e5006fde7ca63af79b25052ac7df3e Mon Sep 17 00:00:00 2001 From: koide Date: Sat, 28 Feb 2026 01:07:48 +0000 Subject: [PATCH] =?UTF-8?q?Add:=20=E8=A8=98=E4=BA=8B=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=AB=E3=83=90=E3=83=8A=E3=83=BC=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E3=82=92=E3=83=92=E3=83=BC=E3=83=AD=E3=83=BC=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=20(DocItem=20swizzle)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/theme/DocItem/Layout/index.tsx | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/theme/DocItem/Layout/index.tsx 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 && ( +
+ +
+ )} + + + ); +}