Files

111 lines
2.3 KiB
Ruby

xml.instruct! :xml, :version => "1.0"
xml.urlset :xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9" do
# /
xml.url do
xml.loc root_url
xml.lastmod Date.today
xml.changefreq "daily"
xml.priority "0.9"
end
Product.all_ordered.each do |product|
# product pages
xml.url do
xml.loc product_url(product)
xml.lastmod product.last_updated_page.updated_at.to_date
xml.changefreq "weekly"
xml.priority "1.0"
end
for product_page in product.product_pages
xml.url do
xml.loc product_page_url(product, product_page)
xml.lastmod product_page.updated_at.to_date
xml.changefreq "weekly"
xml.priority "1.0"
end unless product_page == product.default_page || pricing_licensing?(product_page)
end
end
Product.all_ordered.non_free.each do |product|
xml.url do
xml.loc order_url(product)
xml.changefreq "weekly"
xml.priority "0.8"
end
end
# download pages
xml.url do
xml.loc download_url(featured_product)
xml.changefreq "weekly"
xml.priority "0.7"
end
# /support
xml.url do
xml.loc url_for(:controller => "support", :only_path => false)
xml.changefreq "weekly"
end
# /comics
xml.url do
xml.loc url_for(:controller => "comics", :only_path => false)
xml.changefreq "daily"
xml.lastmod latest_comic.publish_on
end
# /comics/:id
Comic.published.reverse_ordered.each do |comic|
xml.url do
xml.loc comic_url(comic)
xml.changefreq "monthly"
xml.priority "0.5"
end
end
# /blog
xml.url do
xml.loc blog_url
xml.lastmod Date.today
xml.changefreq "daily"
xml.priority "0.6"
end
# /about-us
xml.url do
xml.loc about_url
xml.changefreq "weekly"
end
# /quick-start-guide/better-listview/index.html
xml.url do
xml.loc "#{root_url}/quick-start-guide/better-listview/index.html"
xml.changefreq "weekly"
end
# /sitemap
xml.url do
xml.loc sitemap_url
xml.changefreq "weekly"
end
# /disclaimer
xml.url do
xml.loc disclaimer_url
xml.changefreq "monthly"
xml.priority "0.1"
end
# /privacy-policy
xml.url do
xml.loc privacy_policy_url
xml.changefreq "monthly"
xml.priority "0.1"
end
end