Add more detail to OpenGraph tags
[rails.git] / app / helpers / open_graph_helper.rb
1 module OpenGraphHelper
2   def opengraph_tags(title = nil)
3     tags = {
4       "og:site_name" => t("layouts.project_name.title"),
5       "og:title" => [t("layouts.project_name.title"), title].compact.join(" | "),
6       "og:type" => "website",
7       "og:image" => image_path("osm_logo.svg", :host => SERVER_URL),
8       "og:image:width" => "200",
9       "og:image:height" => "200"
10     }
11
12     tags.map do |property, content|
13       tag(:meta, :property => property, :content => content)
14     end.join("").html_safe
15   end
16 end