garmeeh/next-seo

Bug: <DefaultSeo /> OG image does not get added to pages with <NextSEO/>

JakeSchroeder opened this issue · 2 comments

I would expect by using Default NextSEO like the docs say:

_app.tsx
...
<DefaultSeo
        openGraph={{
          type: 'website',
          locale: 'en_US',
          images: [{ url: https://mywebsite.com/social-card-main.png }],
        }}
 />      

Would populate pages that implement without the OG Image

about.tsx
...

<NextSEO
        title="About - My Website"
        description="My cool website"
        canonical="https:/mywebsite/about"
/>

But it doesn't work. In other words, wherever you merge the props you should only override used props and not unused like og image in this case. Now I have to explicitly set each pages og image.

same issue

"next-seo": "^6.1.0"

I would expect by using Default NextSEO like the docs say:

_app.tsx
...
<DefaultSeo
        openGraph={{
          type: 'website',
          locale: 'en_US',
          images: [{ url: https://mywebsite.com/social-card-main.png }],
        }}
 />      

Would populate pages that implement without the OG Image

about.tsx
...

<NextSEO
        title="About - My Website"
        description="My cool website"
        canonical="https:/mywebsite/about"
/>

But it doesn't work. In other words, wherever you merge the props you should only override used props and not unused like og image in this case. Now I have to explicitly set each pages og image.

This occurs with any default props. I believe that this override (and some cases overrides by NextJS like #1134 ) is due to where you define the DefaultSEO.

Documentation shows an old way to declare a custom container to wrap an app with SEO.