aredotna / ervell

Are.na front-end client
MIT License
180 stars 33 forks source link

Missing Twitter card for profiles #1793

Open broskoski opened 5 years ago

broskoski commented 5 years ago

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

dzucconi commented 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?

broskoski commented 5 years ago

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: screen shot 2019-02-12 at 4 09 59 pm

dzucconi commented 5 years ago

Can you check if twitter cards invoke client-side code?

broskoski commented 5 years ago

Does not appear so: https://twittercommunity.com/t/support-for-dynamically-added-meta-tags/62862/3

broskoski commented 5 years ago

More context here: https://github.com/nfl/react-helmet/issues/26

dzucconi commented 5 years ago

Right that's fine. I'd just add a node and add it.