From d562f6537e608bd670d61e6f90523a13efd281a1 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 20 Jan 2016 15:42:01 +1100 Subject: [PATCH] Cleaner opengraph meta tags --- app/assets/images/logo-black2.png | Bin 2082 -> 0 bytes app/helpers/application_helper.rb | 4 ---- app/views/enterprises/shop.html.haml | 2 +- app/views/groups/show.html.haml | 2 +- app/views/layouts/darkswarm.html.haml | 6 +++--- config/locales/en.yml | 3 +-- 6 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 app/assets/images/logo-black2.png diff --git a/app/assets/images/logo-black2.png b/app/assets/images/logo-black2.png deleted file mode 100644 index 6229ae2d9ef1c7889bcd5e5ef8df7490d26c0e8f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2082 zcmb7FYdDjQA6_XkQBlszA#>Ox>okRzQqDpxTOJD?o{8qz9J8jw+e<`Fn^&w7Q?@7Z zI3<##cqbLHvbRx6-XTN|%~pSX{C|7j`?`MDecku(zV0u-55LO?yj@k%x@Z&%rRwhH zL`0#M`=L{ci&IWsLoe=HI1zV!&N ziE&#J%29409feZS_%+K=*NU{4Or;oiFK4B})v9aF^aX8WACe+@LkREbhp@+POwYb=Ft2)P6+XWXKPd_Az%ScVzc3rZ@y`&=2V3 zL&I5c*!cX6xS(7`nbGX=vL2!aEh=7=HJ}TU9jZz`PR)2i&aG!606PT1dMY8jeD>9v z35#T_6O#B0hdE<;e2u77?Sa~}%pEKrCXqbFQ9!Q$l-^4j*<>-;lFRLyBpUq2J=Jt0 z2mAO$XIuID0(l-b6J{I)KV)t6+)R}i0T{1SAla76^(ITNSSrW+KcoCe2BifpJv+m2 z&IS~IaEPF1CHNrS5)6?)d4*6Dl^x9at6BmeiQTOOX^xfNjcUosda)R5R&9)*&ZQ3& zDmRcUZL$RI6xZwpl8_=Lt-RV@%zQ1#M#1@EktO)$-S@u-_pvLQk9x5|SuP;(Hz3@< z7p2}5aB&jXrLEQeByQaHJ|fdiy;4SydY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W6{v6HF&*ke#)=sqn$`!EwVEfzeCK+460KRSI?^ePNGV7mc zLJd_daqXwKJv$yf(yh~0Z{BvROgP1}@_icq0SBv)`0_*l;S2tM^j!RuQm?$Cux2Q) Q^4G@Q+1sgN@6ikY1E^uT^#A|> diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 80b4a5d4d10..15c20dfd55f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,8 +25,4 @@ def method_missing(method, *args, &block) 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 d3169647e0e..f2063494b4a 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -3,7 +3,7 @@ - content_for(:description) do = current_distributor.description - content_for(:image) do - = current_distributor.logo + = current_distributor.logo.url = inject_enterprises diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index ed98d3b2caf..4831a911a66 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -3,7 +3,7 @@ - content_for(:description) do = @group.description - content_for(:image) do - = @group.logo + = @group.logo.url -# 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 016af8d30d0..07882863942 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -2,9 +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"}/ + %meta{property: "og:title", content: content_for?(:title) ? yield(:title) : t(:title)} + %meta{property: "og:description", content: content_for?(:description) ? yield(:description) : t(:description)} + %meta{property: "og:image", content: content_for?(:image) ? yield(:image) : ContentConfig.logo.url} %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 963cf0edff0..eb47b642244 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -29,6 +29,7 @@ en: home: "OFN" title: Open Food Network welcome_to: 'Welcome to ' + 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…" search_by_name: Search by name or suburb... producers: Aussie Producers producers_join: Australian producers are now welcome to join the Open Food Network. @@ -674,5 +675,3 @@ 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…" -