thegazelle-ad / gazelle-server

Server for front-end and editor tools of The Gazelle
MIT License
19 stars 8 forks source link

Add OpenGraph meta tags on serverside render #468

Closed emilgoldsmith closed 5 years ago

emilgoldsmith commented 5 years ago

Related Issue

Thought I would do #390, but actually that was way too hard, and a huge undertaking (big rewrites of the codebase), so I've just added the opengraph meta tags on serverside renders through a hack

Description

When we disabled serverside rendering the javascript in our React components that was previously setting the opengraph information that let's Facebook display the images and text when you share a link was no longer running. I have therefore created a bit of a hack so we can add in this information on serverside without doing the full React render as that doesn't currently work

How Has This Been Tested?

Manually with https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2F310780db.ngrok.io

I could probably add in some good unit tests for some of these functions, but to be honest I just don't have the time right now :(, and this is very high priority, sorry for bad practices!

Screenshots (if appropriate):

Checklist:

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.05%) to 6.198% when pulling d07dc26631af7cf102681d957a9fd5fd66571c1f on add-serverside-opengraph into 31fd2e941b1456684d769b49caf9cafba5781e70 on master.

emilgoldsmith commented 5 years ago

maybe we could open an issue for that so it can be added when we have time.

True statement, but so little of our codebase is tested right now that we need tests on all kinds of things so I feel like if we created an issue like that we could just as well create 50 more for other parts of the code :P

emilgoldsmith commented 5 years ago

We just generally need to put in an effort to refactor a lot of the codebase :)