-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Hey hey 👋🏻
Our PlayTorch website and API docs are built with Docusaurus and hosted on Vercel!
The website includes dynamic routes that embed Expo Snacks and render the route name in a hero component plus some additional text. An example is this url:
https://playtorch.dev/snack/@raedle/image-classification/
When sharing the URL via text messaging or social media, we would like it to show a preview with the route name as title. However, it currently renders the text "PlayTorch is a framework for rapidly creating mobile AI experiences." instead of "@raedle/image-classification | PlayTorch Snack" (see screenshot).
We used @docusaurus/Head to change the page metadata, which works on the client, but not for OG previews. I can repro if I disable JavaScript on the client.
I tried the following PR, but that doesn't seem to work: facebookresearch/playtorch#103 (the Vercel preview of the PR is linked in the PR)
Is there a way to get Open Graph meta tags enabled for dynamic routes?
Thank you!
Reproducible demo
No response
Steps to reproduce
The PR facebookresearch/playtorch#103 adds og: meta tags via the @docusaurus/Head. The Vercel preview in this PR can be used for testing the issue
Expected behavior
It is expected that the og: meta tags provided via @docusaurus/Head would also apply when sharing links for dynamic routes (i.e., links would show previews with content from meta tags)
Actual behavior
The meta tags don't apply when sharing links to dynamic routes
Your environment
No response
Self-service
- I'd be willing to fix this bug myself.
