mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-31 18:07:00 +02:00
fix(v2): correct typo in metas generated for Twitter cards (#3900)
The Open Graph protocol format is the following: ``` <meta property="og:image" content="https://example.com/image.png /> ``` Twitter metas, however, are structured in a different format: ``` <meta name="twitter:image" content="https://example.com/image.png /> ``` They are similar but not identical, I think this led to confusion and the typo we have in the codebase.
This commit is contained in:
parent
b14b9c88f3
commit
656c04e1d5
6 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ function Layout(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||||
{metaImage && <meta property="twitter:image" content={metaImageUrl} />}
|
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||||
{metaImage && (
|
{metaImage && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -43,7 +43,7 @@ function DocItem(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||||
{metaImage && <meta property="twitter:image" content={metaImageUrl} />}
|
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||||
{metaImage && (
|
{metaImage && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -59,7 +59,7 @@ function Layout(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||||
{metaImage && <meta property="twitter:image" content={metaImageUrl} />}
|
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||||
{metaImage && (
|
{metaImage && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -102,7 +102,7 @@ function BlogPostItem(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{image && <meta property="og:image" content={imageUrl} />}
|
{image && <meta property="og:image" content={imageUrl} />}
|
||||||
{image && <meta property="twitter:image" content={imageUrl} />}
|
{image && <meta name="twitter:image" content={imageUrl} />}
|
||||||
{image && (
|
{image && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -71,7 +71,7 @@ function DocItem(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||||
{metaImage && <meta property="twitter:image" content={metaImageUrl} />}
|
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||||
{metaImage && (
|
{metaImage && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
<meta name="twitter:image:alt" content={`Image for ${title}`} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default function LayoutHead(props: Props): JSX.Element {
|
||||||
<meta name="keywords" content={keywords.join(',')} />
|
<meta name="keywords" content={keywords.join(',')} />
|
||||||
)}
|
)}
|
||||||
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
{metaImage && <meta property="og:image" content={metaImageUrl} />}
|
||||||
{metaImage && <meta property="twitter:image" content={metaImageUrl} />}
|
{metaImage && <meta name="twitter:image" content={metaImageUrl} />}
|
||||||
{metaImage && (
|
{metaImage && (
|
||||||
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue