Open broskoski opened 5 years ago
Ah when I looked at this I assumed we didn't have images for profiles. Yes I would write a custom node and return a single image for it. Why not avatar though?
I think avatar is probably more logical, but it would probably just look shitty most of the time. To be clear we are talking about these cards:
Can you check if twitter cards invoke client-side code?
Does not appear so: https://twittercommunity.com/t/support-for-dynamically-added-meta-tags/62862/3
More context here: https://github.com/nfl/react-helmet/issues/26
Right that's fine. I'd just add a node and add it.
On jade rendered routes, we currently automatically populate twitter cards for the given page:
https://github.com/aredotna/ervell/blob/37483bc54fea95158ffa9ef09cc0882c41ee8c65/components/meta/templates/meta.jade#L37
After switching to React rendered profiles, these tags are no longer present. Check for cards here: https://cards-dev.twitter.com/validator
After looking into this for ten minutes, I actually thought it would be preferable to make a field specifically for this in GraphQL (i.e.
meta_images
that would just return an array of images from the given profile.Something else to consider is only rendering these meta tags for social bot / agents: https://stackoverflow.com/questions/29261733/detect-social-bots-in-node-express