Use image_url instead of image_path with the host option

Fixes #1379
This commit is contained in:
Tom Hughes 2016-11-24 20:23:42 +00:00
parent 1e3a35f971
commit 1309661b15
4 changed files with 7 additions and 7 deletions

View file

@ -4,8 +4,8 @@ module OpenGraphHelper
"og:site_name" => t("layouts.project_name.title"), "og:site_name" => t("layouts.project_name.title"),
"og:title" => [t("layouts.project_name.title"), title].compact.join(" | "), "og:title" => [t("layouts.project_name.title"), title].compact.join(" | "),
"og:type" => "website", "og:type" => "website",
"og:image" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "http"), "og:image" => image_url("osm_logo_256.png", :protocol => "http"),
"og:image:secure_url" => image_path("osm_logo_256.png", :host => SERVER_URL, :protocol => "https"), "og:image:secure_url" => image_url("osm_logo_256.png", :protocol => "https"),
"og:url" => url_for(:host => SERVER_URL), "og:url" => url_for(:host => SERVER_URL),
"og:description" => t("layouts.intro_text") "og:description" => t("layouts.intro_text")
} }

View file

@ -5,12 +5,12 @@ atom_feed(:language => I18n.locale, :schema_date => 2009,
feed.title changeset_list_title(params, @user) feed.title changeset_list_title(params, @user)
feed.updated @edits.map { |e| [e.created_at, e.closed_at].max }.max feed.updated @edits.map { |e| [e.created_at, e.closed_at].max }.max
feed.icon image_path("favicon.ico", :host => SERVER_URL) feed.icon image_url("favicon.ico")
feed.logo image_path("mag_map-rss2.0.png", :host => SERVER_URL) feed.logo image_url("mag_map-rss2.0.png")
feed.rights :type => "xhtml" do |xhtml| feed.rights :type => "xhtml" do |xhtml|
xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a| xhtml.a :href => "http://creativecommons.org/licenses/by-sa/2.0/" do |a|
a.img :src => image_path("cc_button.png", :host => SERVER_URL), :alt => "CC by-sa 2.0" a.img :src => image_url("cc_button.png"), :alt => "CC by-sa 2.0"
end end
end end

View file

@ -9,7 +9,7 @@ xml.rss("version" => "2.0",
xml.description @description xml.description @description
xml.link url_for(:action => "list", :host => SERVER_URL) xml.link url_for(:action => "list", :host => SERVER_URL)
xml.image do xml.image do
xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL) xml.url image_url("mag_map-rss2.0.png")
xml.title @title xml.title @title
xml.width "100" xml.width "100"
xml.height "100" xml.height "100"

View file

@ -10,7 +10,7 @@ xml.rss("version" => "2.0",
xml.link url_for(:controller => :trace, :action => :list, :only_path => false) xml.link url_for(:controller => :trace, :action => :list, :only_path => false)
xml.image do xml.image do
xml.url image_path("mag_map-rss2.0.png", :host => SERVER_URL) xml.url image_url("mag_map-rss2.0.png")
xml.title t("trace.georss.title") xml.title t("trace.georss.title")
xml.width 100 xml.width 100
xml.height 100 xml.height 100