diff --git a/app/assets/images/logo-black2.png b/app/assets/images/logo-black2.png new file mode 100644 index 0000000000..6229ae2d9e Binary files /dev/null and b/app/assets/images/logo-black2.png differ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 15c20dfd55..80b4a5d4d1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,4 +25,8 @@ module ApplicationHelper super end end + + def image_url(file) + request.protocol + request.host_with_port + path_to_image(file) + end end diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index 35937629fc..d3169647e0 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -1,5 +1,9 @@ - content_for(:title) do = current_distributor.name +- content_for(:description) do + = current_distributor.description +- content_for(:image) do + = current_distributor.logo = inject_enterprises diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index b4e6f7586c..ed98d3b2ca 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,5 +1,9 @@ - content_for(:title) do = @group.name +- content_for(:description) do + = @group.description +- content_for(:image) do + = @group.logo -# inject all enterprises as "enterprises" -# it could be more efficient to inject only the enterprises that are related to the group diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index a933858049..016af8d30d 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -2,7 +2,9 @@ %head %meta{charset: 'utf-8'}/ %meta{name: 'viewport', content: "width=device-width,initial-scale=1.0"}/ - + %meta{:content => yield(:title).empty? ? "#{t(:title)}" : yield(:title), :property => "og:title"}/ + %meta{:content => yield(:description).empty? ? "#{t(:og_description)}" : yield(:description), :property => "og:description"}/ + %meta{:content => yield(:image).empty? ? image_url("logo-black2.png") : image_url(yield(:image)), :property => "og:image"}/ %title= content_for?(:title) ? "#{yield(:title)} - #{t(:title)}".html_safe : "#{t(:welcome_to)} #{t(:title)}" - if Rails.env.production? = favicon_link_tag diff --git a/config/locales/en.yml b/config/locales/en.yml index 76f0c124b3..963cf0edff 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -674,3 +674,5 @@ Please follow the instructions there to make your enterprise visible on the Open price_graph: "Price graph" included_tax: "Included tax" remove_tax: "Remove tax" + og_description: "We begin from the ground up. With farmers and growers ready to tell their stories proudly and truly. With distributors ready to connect people with products fairly and honestly. With buyers who believe that better weekly shopping decisions can…" +