Solid-Meta on dynamic SSR routes
I am trying to set dynamically set metadata for Slack/X preview cards.
In this example, the title *does update dynamically, but only client-side.
If I post this URL to Slack, the preview card gets the default
<Title>
which is set in my app.jsx
file. Also worth noting that I have set the `og: meta tags and the
twitter:*` ones too but omitted them from the example to keep it short
I want people to be able to share video URLs on Slack and Twitter and elsewhere and the previews to show the dynamically generated metadata content.
How can I do this? Am I missing something or is there some bug in my code?8 Replies
This should work - I've done the same as your code and got this on
/some-video-id

Here is the actual example website: https://mde.wes.software/series/pgl/96-appreciate-every-cigarette.
If you open the page, the title and the rest of the metadata does change correctly.
But if you inspect it here: https://metatags.io/?url=https%3A%2F%2Fmde.wes.software%2Fseries%2Fpgl%2F96-appreciate-every-cigarette you can see it is not applied. This means that Twitter/X/Slack previews won't work as expected
MDE.tv
MDE.tv
For all Sam Hyde content, sign up here. (Including the podcast with Nick, doy (this is all that stuff)).
Hmm is
VideoPage
underneath another Suspense
that's not being deferred?
actually idk if that changes things since Suspense
runs both branches in parallelThere is a top level
Suspense
just after the MetaProvider
in the Router
Oh actually if there's a
<Show>
above it that triggers the Suspense
then that could cause the stream to flush earlyYeah, it seems to be related to that. I moved some
Suspense
and Show
above it and it seems to work now. Thanks!Nice!