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:
Méril 2020-12-10 16:09:20 +00:00 committed by GitHub
parent b14b9c88f3
commit 656c04e1d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View file

@ -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}`} />
)} )}

View file

@ -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}`} />
)} )}

View file

@ -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}`} />
)} )}

View file

@ -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}`} />
)} )}

View file

@ -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}`} />
)} )}

View file

@ -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}`} />
)} )}