garmeeh/next-seo

OpenGraph image doesn't work on linkedin because the meta tag is missing a name attribute

voiys opened this issue · 1 comments

voiys commented

Describe the bug
My OpenGraph image is not showing up on linkedin

Reproduction
I use the openGraph property as usual

Expected behavior
There should be an image embedded when I share the link

Additional context
This is what it says in their debugged, I've managed to get around it by adding a <Head /> with the meta tag that has the name attribute
image

voiys commented

I'd add this to a PR but it doesn't let me push the branch

inside src/meta/buildTags.tsx:

if (mediaType === 'image') {
      tags.push(
        <meta
          key={`og:${mediaType}:0${index}`}
          name={mediaType}
          property={`og:${mediaType}`}
          content={medium.url}
        />,
      );
    } else {
      tags.push(
        <meta
          key={`og:${mediaType}:0${index}`}
          property={`og:${mediaType}`}
          content={medium.url}
        />,
      );
    }