def sitemap
      require 'builder'
      
      xml = ::Builder::XmlMarkup.new :indent => 2
      xml.instruct!
      xml.tag! :urlset, {
        'xmlns'=>"http://www.sitemaps.org/schemas/sitemap/0.9",
        'xmlns:xsi'=>"http://www.w3.org/2001/XMLSchema-instance",
        'xsi:schemaLocation'=>"http://www.sitemaps.org/schemas/sitemap/0.9\nhttp://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
      } do

        base_url = "#{request.protocol}#{request.host}#{request.port==80 ? '' : ":#{request.port}"}"

        if root_page = Page.root_page
          Humpyard.config.locales.each do |locale|
            add_to_sitemap xml, base_url, locale, [{
                :index => true,
                :url => root_page.human_url(:locale => locale),
                :lastmod => root_page.last_modified,
                :children => []
              }] + root_page.child_pages(:single_root => true).map{|p| p.content_data.site_map(locale)}
          end
        end
      end
      render :xml => xml.target!
    end
def sitemap
      require 'builder'
      
      xml = ::Builder::XmlMarkup.new :indent => 2
      xml.instruct!
      xml.tag! :urlset, {
        'xmlns'=>"http://www.sitemaps.org/schemas/sitemap/0.9",
        'xmlns:xsi'=>"http://www.w3.org/2001/XMLSchema-instance",
        'xsi:schemaLocation'=>"http://www.sitemaps.org/schemas/sitemap/0.9\nhttp://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
      } do

        base_url = "#{request.protocol}#{request.host}#{request.port==80 ? '' : ":#{request.port}"}"

        if root_page = Page.root_page
          Humpyard.config.locales.each do |locale|
            add_to_sitemap xml, base_url, locale, [{
                :index => true,
                :url => root_page.human_url(:locale => locale),
                :lastmod => root_page.last_modified,
                :children => []
              }] + root_page.child_pages(:single_root => true).map{|p| p.content_data.site_map(locale)}
          end
        end
      end
      render :xml => xml.target!
    end
Render the sitemap.xml for robots