Skip to content

Commit 6df043d

Browse files
committed
Prevent homepage with locale in path to be duplicate
1 parent cf93063 commit 6df043d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/app/views/refinery/sitemap/index.xml.builder

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
55
::I18n.locale = locale
66

77
::Refinery::Page.live.in_menu.each do |page|
8-
8+
99
# exclude sites that are external to our own domain.
1010
if page.url.is_a?(Hash)
1111

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

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

0 commit comments

Comments
 (0)