From 6917eb950c9f28e9754d73dfedcf291bbfd29a82 Mon Sep 17 00:00:00 2001 From: Welly Date: Thu, 28 Jan 2021 00:42:22 +0800 Subject: [PATCH] feat(v2): supports string type for the Layout's keywords props (#4090) * feat(v2): support string type for the keywords props * Update the type definition of Layout --- .../docusaurus-theme-classic/src/theme/LayoutHead/index.tsx | 5 ++++- packages/docusaurus-theme-classic/src/types.d.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/LayoutHead/index.tsx b/packages/docusaurus-theme-classic/src/theme/LayoutHead/index.tsx index c0cfc29cf6..c263477449 100644 --- a/packages/docusaurus-theme-classic/src/theme/LayoutHead/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/LayoutHead/index.tsx @@ -81,7 +81,10 @@ export default function LayoutHead(props: Props): JSX.Element { )} {keywords && keywords.length && ( - + )} {metaImage && } {metaImage && } diff --git a/packages/docusaurus-theme-classic/src/types.d.ts b/packages/docusaurus-theme-classic/src/types.d.ts index d3e889ade8..5355db8b88 100644 --- a/packages/docusaurus-theme-classic/src/types.d.ts +++ b/packages/docusaurus-theme-classic/src/types.d.ts @@ -237,7 +237,7 @@ declare module '@theme/Layout' { noFooter?: boolean; description?: string; image?: string; - keywords?: string[]; + keywords?: string | string[]; permalink?: string; wrapperClassName?: string; searchMetadatas?: {