]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/open_graph_helper.rb
Add default browse icons for nodes, ways, relations
[rails.git] / app / helpers / open_graph_helper.rb
index dbd20446295d76a556d10a28481e26eb40a7e039..a496268e49909c7381cec21ec2729c15dfc4aeb4 100644 (file)
@@ -4,12 +4,14 @@ module OpenGraphHelper
   def opengraph_tags(title, properties)
     tags = {
       "og:site_name" => t("layouts.project_name.title"),
-      "og:title" => title || t("layouts.project_name.title"),
+      "og:title" => properties["og:title"] || title || t("layouts.project_name.title"),
       "og:type" => "website",
       "og:url" => url_for(:only_path => false),
-      "og:description" => t("layouts.intro_text")
+      "og:description" => properties["og:description"] || t("layouts.intro_text")
     }.merge(
       opengraph_image_properties(properties)
+    ).merge(
+      properties.slice("article:published_time")
     )
 
     safe_join(tags.map do |property, content|