Sha256: 781358d06d493e231b38ef8ab8ac2659987cc17752eaa88263f4195663f1d19f

Contents?: true

Size: 448 Bytes

Versions: 7

Compression:

Stored size: 448 Bytes

Contents

class Character::Sitemap::SitemapGeneratorHelper
  def self.add_links(sitemap)
    url_helpers = Rails.application.routes.url_helpers
    url = "http://#{ @domain }"

    sitemap.add "#{ url }#{ url_helpers.posts_index_path }",
      changefreq: "daily"

    Character::Post.published.each do |post|
      sitemap.add "#{ url }#{ url_helpers.posts_show_path(post) }",
        changefreq: "weekly",
        lastmod: post.updated_at
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
character-1.0.6 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.5 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.4 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.3 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.2 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.1 app/models/character/sitemap/sitemap_generator_helper.rb
character-1.0.0 app/models/character/sitemap/sitemap_generator_helper.rb