Skip to content

Commit

Permalink
Cleaner opengraph meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mkllnk committed Jan 20, 2016
1 parent 07d691f commit d562f65
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
Binary file removed app/assets/images/logo-black2.png
Binary file not shown.
4 changes: 0 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/views/enterprises/shop.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- content_for(:description) do
= current_distributor.description
- content_for(:image) do
= current_distributor.logo
= current_distributor.logo.url

= inject_enterprises

Expand Down
2 changes: 1 addition & 1 deletion app/views/groups/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/darkswarm.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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…"

0 comments on commit d562f65

Please sign in to comment.