We have a Next.JS web app that is being served with service stack (in a similar way as the vue service stack template). One of our pages is a detail view for some of our content and we set it up to allow for the link to be publicly shared through social media.
However, due to the nature of the web app being a SPA there is no way for us to set meta tags (open graph) through server side rendering. Is there any way you recommend to solve this?
One solution that I thought might work would be to check the user agent on the page request to see if it is a bot and return a razor templated page that just has the meta tags.
Here is how the link card looks on linkedin, for example:
Side Note: For some reason it shows the title as being 404, but when i curl the url the title tag has “Video Detail”. Is ServiceStack checking user agent already and auto redirecting to a 404 page?
- Is there any way you recommend to solve this?
- Does ServiceStack have any built in solutions for this? Bot detection?
- Should this be done with a request filter or routing?