Sha256: 4f0874b64aa17b2c8ef73651cadca0a92aaf0248584a17af0bb66c377eb73084

Contents?: true

Size: 721 Bytes

Versions: 5

Compression:

Stored size: 721 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
          Globalize.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

5 entries across 5 versions & 1 rubygems

Version Path
spina-0.12.0 app/views/spina/sitemaps/show.xml.builder
spina-0.11.1 app/views/spina/sitemaps/show.xml.builder
spina-0.11.0 app/views/spina/sitemaps/show.xml.builder
spina-0.10.0 app/views/spina/sitemaps/show.xml.builder
spina-0.9.0 app/views/spina/sitemaps/show.xml.builder