HumanRightsMeasurementInitiative / hrmi-dataportal

https://rightstracker.org
Other
4 stars 8 forks source link

[WIP] Feature/social preview #199

Closed iainkirkpatrick closed 4 years ago

iainkirkpatrick commented 4 years ago

Adds social preview features to specific pages in the app (i.e. when shared on Twitter, Facebook, Linkedin, Slack etc). This is done through programmatic generation with three steps:

The list of countries, rights and indicators that result in the pages are driven from the en.json language file - so this means in the future, if there are additional rights, indicators etc, as long as they are added in the same format to the language file then the script can be re-run and everything should just work 😄 .

I haven't adjusted the sharing 'description' for each page yet, currently it's still just "HRMI Rights Tracker" - this can be changed easily though depending on which content we want to be there.

N.B. Rights pages don't currently display the same sidebar images when previewing as they do in the app - for rights pages, these are SVG's, and the format for social previews doesn't allow SVG's. One option is we upload .PNG versions of these SVG's somewhere to be used for this sharing purpose.

N.B. No support yet for languages other than English in sharing - can discuss if we want this (it might be more important if we have descriptions in there?). Should be reasonably straightforward to generate.

@bsides44 FYI

Closes #162

TODO:

iainkirkpatrick commented 4 years ago

Closing in favour of merging into staging in #204