Display full url in sitemap
This commit is contained in:
@@ -34,7 +34,7 @@ module Cmtool
|
||||
respond_to do |format|
|
||||
format.xml do
|
||||
pages_xml = ::Page.for_sitemap.map do |page|
|
||||
uri = page_path(page.name, locale: page.locale)
|
||||
uri = page_url(page.name, locale: page.locale)
|
||||
"<url><loc>#{uri}</loc><lastmod>#{page.updated_at.strftime('%Y-%m-%d')}</lastmod></url>"
|
||||
end.join("\n")
|
||||
result = <<-XML
|
||||
|
||||
@@ -6,7 +6,7 @@ feature 'sitemap.xml' do
|
||||
p1 = Page.create name: 'en-1', title: 'EN 1', locale: 'en'
|
||||
visit "/sitemap.xml"
|
||||
page.body.should include "<lastmod>#{Date.today.strftime('%Y-%m-%d')}</lastmod>"
|
||||
page.body.should include "<loc>/en/en-1</loc>"
|
||||
page.body.should include "<loc>/nl-1</loc>"
|
||||
page.body.should include "<loc>http://www.example.com/en/en-1</loc>"
|
||||
page.body.should include "<loc>http://www.example.com/nl-1</loc>"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user