Sha256: b284a81db5ab5e3f97b74e2d2c9154c8b7ad118338e7ed1b6f09d5268d333b2a

Contents?: true

Size: 764 Bytes

Versions: 26

Compression:

Stored size: 764 Bytes

Contents

xml.instruct! :xml, :version => '1.0', :encoding => 'UTF-8'

xml.urlset :xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9' do
  @cms_site.pages.published.each do |page|
    xml.url do 
      xml.loc "http://#{@cms_site.hostname}#{"/" + @cms_site.path unless @cms_site.path.blank? }#{page.full_path}"
      # just take some guesses the closer to the root means higher priority
      # start subtracting 0.1 for every additional child page, max out at 0.1
      # "/" splits to 0, "/child_page" splits to 2, hence weird max -1 
      xml.priority [1 - (0.1 * ( ( [page.full_path.split("/").count, 1].max - 1 ) ) ), 0.1].max
      xml.lastmod page.updated_at.strftime('%Y-%m-%d')
    end
  end
  ComfortableMexicanSofa::Sitemap.process(@cms_site, self, xml)
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.31 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.5 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.4 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.3 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.2 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.1 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.8.0 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.30 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.7.3 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.7.1 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.7.0 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.26 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.25 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.24 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.23 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.22 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.21 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.20 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.19 app/views/cms_content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.6.18 app/views/cms_content/render_sitemap.xml.builder