mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-26 06:27:59 +02:00
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
This commit is contained in:
parent
95f81d2a44
commit
6917eb950c
2 changed files with 5 additions and 2 deletions
|
@ -81,7 +81,10 @@ export default function LayoutHead(props: Props): JSX.Element {
|
|||
<meta property="og:description" content={description} />
|
||||
)}
|
||||
{keywords && keywords.length && (
|
||||
<meta name="keywords" content={keywords.join(',')} />
|
||||
<meta
|
||||
name="keywords"
|
||||
content={Array.isArray(keywords) ? keywords.join(',') : keywords}
|
||||
/>
|
||||
)}
|
||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||
|
|
|
@ -237,7 +237,7 @@ declare module '@theme/Layout' {
|
|||
noFooter?: boolean;
|
||||
description?: string;
|
||||
image?: string;
|
||||
keywords?: string[];
|
||||
keywords?: string | string[];
|
||||
permalink?: string;
|
||||
wrapperClassName?: string;
|
||||
searchMetadatas?: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue