Closed colonder closed 9 months ago
@colonder I have found this article https://medium.com/@moh.mir36/open-graph-with-next-js-v13-app-directory-22c0049e2087 that walks through how to implement opengraph image in Next 13.
Let me know if that helps.
Yes, I must've understood smth wrong about how OG works.
Summary
I'm trying to dynamically generate opengraph image, and I placed
opengraph-image.tsx
in/src/app/[lang]
directory. I used the following codeThe meta tag is generated as
and the preview is not visible neither in the browser nor in messaging apps. When I type the above link in my browser as is, the image is not found, but when I replace the
[lang]
part with a specific language likeen
it works just fine. How can I fix it? Another question: can I make just one OG image for the entire app or do I have to create this file in every single directory withpage.tsx
?