Replies: 1 comment 1 reply
-
Hmm, interesting question. What kind of response do you get at Are you using i18n functionality in the opengraph image generation? While the middleware won't automatically associate a locale with your request, you can for example call Alternatively, you could return an OG image from a custom Route Handler and include a link to that in your pages—this way you have full control over the URL. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm trying to set a dynamic opengraph image generation using https://nextjs.org/docs/app/api-reference/file-conventions/metadata/opengraph-image#generate-images-using-code-js-ts-tsx.
My issue is that I use a localePrefix like this for my routing:
Which is used in my defineRouting as such:
http://localhost:3000/fr-fr/xxx/opengraph-image?0478f65c6f2e71cd
The property="og:image" content is set automatically to a URL with a locale of the sort which obviously does not work externally due to my matcher only supporting prefixes.
I feel like we can't control the path of the url being used by the ImageResponse object expected by next. Should I take care of redirecting urls with full locales to their prefix? Or is their something I'm not seeing here?
Beta Was this translation helpful? Give feedback.
All reactions