[openstreetmap/openstreetmap-website] Enhance opengraph rich preview for changeset, relation, way, node, user pages (#2007)

Claudius notifications at github.com
Sat Sep 29 19:47:11 UTC 2018


**Reason:**
Changeset, relation, way and node pages are regularly shared on IM and social media channels to discuss, promote or brag about OSM contributions. Right now all of these pages use the same variable "layouts.intro_text" for the OpenGraph description meta tag og:description which is just a general OSM project description: _OpenStreetMap is a map of the world, created by people like you and free to use under an open licence._
See example rich preview for a changeset (and card rendering preview for IM and social media types): https://richpreview.com/?url=https%3A%2F%2Fwww.openstreetmap.org%2Frelation%2F36970
Some prerequisites/observations:
- Page type and IDs/names are already represented in the page title. 
- Rich previews work best for descriptions below 50 characters.
- The relating code currently resides in [openstreetmap-website/app/helpers/open_graph_helper.rb](https://github.com/openstreetmap/openstreetmap-website/blob/1285bcbd712044720c15e2de2e6bacaf4b0b0a92/app/helpers/open_graph_helper.rb#L10) 

**Proposal:**
Description field should describe/represent the page's content. 
Change og:description for detail page types on openstreetmap.org:
* Changeset: _<changeset_description_cropped_to_50_characters> by <osm_username> on <changeset_timestamp>_ 
* Relation: _<relation_name> - <member_count> members - Last changed: <last_updated_timestamp>_ (If relation doesn't have a name use type instead for <relation_name>)
* Way: _<way_name> - <node_count> nodes - Last changed: <last_updated_timestamp>_ (If way doesn't have a name either omit completely or alternatively show key:value for popular top level keys, like highway=*, amenity=*, waterway=*)
* Node: _<node_name> - Location: <latlon> - Last changed: <last_updated_timestamp>_ (Same comment as for way names should apply here as well)
* User: _<changeset_count> changes, last <last_changeset_timestamp> - <track_count> tracks -  <blog_count> blogs_

NB: The OpenGraph description should remain as is (layouts.intro_text) for all other pages

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/2007
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20180929/04a0eff9/attachment.html>


More information about the rails-dev mailing list