]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/open_graph_helper.rb
Collect map layer credits into a data structure
[rails.git] / app / helpers / open_graph_helper.rb
index b3f0ab92849e81be230992c0e3ff1f524258cc64..a496268e49909c7381cec21ec2729c15dfc4aeb4 100644 (file)
@@ -4,12 +4,14 @@ module OpenGraphHelper
   def opengraph_tags(title, properties)
     tags = {
       "og:site_name" => t("layouts.project_name.title"),
   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" => properties["og:description"] || t("layouts.intro_text")
     }.merge(
       opengraph_image_properties(properties)
       "og:type" => "website",
       "og:url" => url_for(:only_path => false),
       "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|
     )
 
     safe_join(tags.map do |property, content|