2010-07-13 00:46:17 +00:00
|
|
|
xml.instruct!
|
|
|
|
xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
|
|
|
|
|
|
|
|
xml.url do
|
2011-04-24 23:21:38 +00:00
|
|
|
xml.loc current_site_url
|
2010-07-13 00:46:17 +00:00
|
|
|
xml.priority 1.0
|
|
|
|
end
|
|
|
|
|
|
|
|
@pages.each do |page|
|
|
|
|
if not page.index_or_not_found?
|
2010-07-19 00:09:10 +00:00
|
|
|
if page.templatized?
|
2011-12-22 23:45:32 +00:00
|
|
|
page.content_type.entries.visible.each do |c|
|
2010-07-19 00:09:10 +00:00
|
|
|
xml.url do
|
2011-04-24 23:21:38 +00:00
|
|
|
xml.loc page_url(page, { :content => c, :host => true })
|
2011-03-08 16:20:53 +00:00
|
|
|
xml.lastmod c.updated_at.to_date.to_s('%Y-%m-%d')
|
2010-07-19 00:09:10 +00:00
|
|
|
xml.priority 0.9
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
xml.url do
|
2011-04-24 23:21:38 +00:00
|
|
|
xml.loc page_url(page, { :host => true })
|
2011-03-08 16:20:53 +00:00
|
|
|
xml.lastmod page.updated_at.to_date.to_s('%Y-%m-%d')
|
2010-07-19 00:09:10 +00:00
|
|
|
xml.priority 0.9
|
|
|
|
end
|
2010-07-13 00:46:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|