spa-github-pages icon indicating copy to clipboard operation
spa-github-pages copied to clipboard

Possible to have dynamic social media cards?

Open maysaleba opened this issue 3 years ago • 1 comments

Hello, is it possible to have a dynamic social media cards when this solution is used?

I've tried using react-helmet to have custom og properties on my app but doesn't seem to work as it will only see the 404.html properties. Is there a workaround to this?

maysaleba avatar Apr 06 '22 20:04 maysaleba

Necro-post, but it has to do with how Github Pages serves 404.html. Since (to Github's servers) the client is requesting a non-existent page, Github's servers respond with a 404 response along with 404.html. This isn't a problem with browsers, but crawlers that social media sites use to search for OpenGraph tags give up when they reach the 404.

A solution I've seen posited is to use a meta refresh on 404.html to pray for it to substitute for a 301 or 302 status code. This didn't work for me (still haven't found a solution :<), but it might for any lurkers of this post.

Article that goes more in depth: http://www.backalleycoder.com/2016/05/13/sghpa-the-single-page-app-hack-for-github-pages/

PixelatedLagg avatar Aug 16 '23 01:08 PixelatedLagg