Sha256: d30e16316ae9ab5602508fbd06a7a88f502af23ee4aa01fd6bee6b4469ef9864

Contents?: true

Size: 732 Bytes

Versions: 35

Compression:

Stored size: 732 Bytes

Contents

xml.instruct!

xml.urlset "xmlns" => "http://www.google.com/schemas/sitemap/0.9", "xmlns:xhtml" => "http://www.w3.org/1999/xhtml" do
  @pages.each do |page|
    xml.url do
      xml.loc "#{request.protocol}#{request.host}#{page.materialized_path}"

      # Translations
      page.translations.each do |translation|
        if translation.locale.in? Spina.config.locales.map(&:to_s)
          Mobility.with_locale(translation.locale) do
            xml.xhtml(:link, rel: "alternate", hreflang: translation.locale, href: "#{request.protocol}#{request.host}#{page.materialized_path}")
          end
        end
      end

      xml.lastmod page.updated_at.to_date
      xml.changefreq "weekly"
      xml.priority 0.9
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
spina-2.10.0 app/views/spina/sitemaps/show.xml.builder
spina-2.9.1 app/views/spina/sitemaps/show.xml.builder
spina-2.9.0 app/views/spina/sitemaps/show.xml.builder
spina-2.8.1 app/views/spina/sitemaps/show.xml.builder
spina-2.8.0 app/views/spina/sitemaps/show.xml.builder
spina-2.7.0 app/views/spina/sitemaps/show.xml.builder
spina-2.6.2 app/views/spina/sitemaps/show.xml.builder
spina-2.6.1 app/views/spina/sitemaps/show.xml.builder
spina-2.6.0 app/views/spina/sitemaps/show.xml.builder
spina-2.5.0 app/views/spina/sitemaps/show.xml.builder
spina-2.4.0 app/views/spina/sitemaps/show.xml.builder
spina-2.3.5 app/views/spina/sitemaps/show.xml.builder
spina-2.3.4 app/views/spina/sitemaps/show.xml.builder
spina-2.3.3 app/views/spina/sitemaps/show.xml.builder
spina-2.3.2 app/views/spina/sitemaps/show.xml.builder
spina-2.3.1 app/views/spina/sitemaps/show.xml.builder
spina-2.3.0 app/views/spina/sitemaps/show.xml.builder
spina-2.2.0 app/views/spina/sitemaps/show.xml.builder
spina-2.1.1 app/views/spina/sitemaps/show.xml.builder
spina-2.1.0 app/views/spina/sitemaps/show.xml.builder