From 6df043d22fbf2b8048765680ba862b1950080c12 Mon Sep 17 00:00:00 2001 From: Brice Sanchez Date: Thu, 6 Jul 2017 17:02:42 -0400 Subject: [PATCH] Prevent homepage with locale in path to be duplicate --- core/app/views/refinery/sitemap/index.xml.builder | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/app/views/refinery/sitemap/index.xml.builder b/core/app/views/refinery/sitemap/index.xml.builder index 383ada7c71..dba4f68f0f 100644 --- a/core/app/views/refinery/sitemap/index.xml.builder +++ b/core/app/views/refinery/sitemap/index.xml.builder @@ -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) @@ -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 @@ -36,4 +36,4 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do end if page_url.present? end end -end \ No newline at end of file +end