Sha256: 9409a63e3f60599ebffc2a14c0f007593f0fdc312ad992420b786dbdee6abe8b

Contents?: true

Size: 608 Bytes

Versions: 11

Compression:

Stored size: 608 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 page.url
      # 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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.12.3 app/views/comfy/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.12.2 app/views/comfy/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.12.1 app/views/comfy/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.12.0 app/views/comfy/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.11.2 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.11.1 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.11.0 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.10.3 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.10.2 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.10.1 app/views/cms/content/render_sitemap.xml.builder
comfortable_mexican_sofa-1.10.0 app/views/cms/content/render_sitemap.xml.builder