Sha256: 76492dd48a204298c2f1879772b1f50aab13aed38d03a65f89271c0c9b5e22b1
Contents?: true
Size: 1.39 KB
Versions: 22
Compression:
Stored size: 1.39 KB
Contents
# Set the host name for URL creation SitemapGenerator::Sitemap.default_host = "http://www.example.com" SitemapGenerator::Sitemap.add_links do |sitemap| # Put links creation logic here. # # The root path '/' and sitemap index file are added automatically. # Links are added to the Sitemap in the order they are specified. # # Usage: sitemap.add path, options # (default options are used if you don't specify) # # Defaults: :priority => 0.5, :changefreq => 'weekly', # :lastmod => Time.now, :host => default_host # Examples: # add '/articles' sitemap.add articles_path, :priority => 0.7, :changefreq => 'daily' # add all individual articles Article.find(:all).each do |a| sitemap.add article_path(a), :lastmod => a.updated_at end # add merchant path sitemap.add '/purchase', :priority => 0.7, :host => "https://www.example.com" end # Including Sitemaps from Rails Engines. # # These Sitemaps should be almost identical to a regular Sitemap file except # they needn't define their own SitemapGenerator::Sitemap.default_host since # they will undoubtedly share the host name of the application they belong to. # # As an example, say we have a Rails Engine in vendor/plugins/cadability_client # We can include its Sitemap here as follows: # # file = File.join(Rails.root, 'vendor/plugins/cadability_client/config/sitemap.rb') # eval(open(file).read, binding, file)
Version data entries
22 entries across 22 versions & 3 rubygems
Version | Path |
---|---|
sitemap_generator-0.3.0 | templates/sitemap.rb |
sitemap_generator-0.2.6 | templates/sitemap.rb |