Skip to content

Commit

Permalink
Prevent homepage with locale in path to be duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez authored Jul 6, 2017
1 parent d4d4a86 commit bd5a019
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/app/views/refinery/sitemap/index.xml.builder
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
::I18n.locale = locale

::Refinery::Page.live.in_menu.each do |page|

# exclude sites that are external to our own domain.
if page.url.is_a?(Hash)

Expand All @@ -17,7 +17,7 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
# handle relative link_url addresses.
raw_url = [request.protocol, request.host_with_port, page.url].join

if (@locales.size > 1) && !page.url.start_with?("/#{locale}/") && defined?(RoutingFilter::RefineryLocales)
if (@locales.size > 1) && !page.url.start_with?("/#{locale}") && !!defined?(RoutingFilter::RefineryLocales)
filter = RoutingFilter::RefineryLocales.new
filter.around_generate({}) do
raw_url
Expand All @@ -36,4 +36,4 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
end if page_url.present?
end
end
end
end

0 comments on commit bd5a019

Please sign in to comment.