I’m attempting to get og tags to work on a RW project.
I’m on a canary version (7.0.0-canary.382
) with SSR enabled. The project is deployed to Render.
My router is very simple and looks like this:
<Router>
<Set wrap={NavigationLayout}>
<Route path="/" page={HomePage} name="Dwelller" prerender />
<Route notfound page={NotFoundPage} />
</Set>
</Router>
The page has MetaTags defined like this:
<MetaTags
title="Dwelller"
description="<My description here>"
ogUrl="https://dwelller.com"
ogContentUrl="<my image url here>.png"
robots={['nofollow']}
/>
Am I missing something?
You can view the deployed project here: https://www.dwelller.com/
When I drop the URL into this OG tag tester, it doesn’t seem to work: OpenGraph - Preview Social Media Share and Generate Metatags - OpenGraph
danny
October 12, 2023, 4:54am
2
Hi Nate,
The reason you’re not seeing this render, is because you will have to update how you deploy your app. For SSR to work, you need to have an actual server running - as opposed to the old way of deploying a static app to CDN.
While SSR/Streaming is still experimental, we haven’t done the full deployment story, but Tobbe wrote up some options here in this old post Render Modes (SSR/Streaming) [Experimental] - #2 by Tobbe
As you are deploying to Render.com - you will need to run what they call a “service”. Personally I think using a Dockerfile might be the easiest - and for reference here’s one from the RW Conference badge app: https://github.com/redwoodjs/ticket-badge-app/blob/staging/Dockerfile . What’s key is the last step where it runs fly/start.sh - see what it does here https://github.com/redwoodjs/ticket-badge-app/blob/staging/.fly/start.sh#L9 where it’s running both the FE server and the API server. Note that this isn’t considered best practice to run two services in a single container
If you’re willing to give it a try, would be very helpful to us to see how we could get multiple services working together