Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the !! add here?

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