SitemapGenerator plugin
Plugin details
Documentation
ruby script/plugin install git://github.com/adamsalter/sitemap_generator-plugin.git
1. Install plugin as normal
./script/plugin install git://github.com/adamsalter/sitemap_generator-plugin.git
2. Installation should create a 'config/sitemap.rb' file which will contain your logic for generation of the Sitemap files. (If you want to recreate this file manually run `rake sitemap:install`)
3. Run `rake sitemap:refresh` as needed to create Sitemap files. This will also ping all the major search engines.
Sitemaps with many urls (100,000+) take quite a long time to generate, so if you need to refresh your Sitemaps regularly you can set the rake task up as a cron job.
4. Finally, and optionally, add the following to your robots.txt file.
Sitemap: HOSTNAME/sitemap_index.xml.gz
The robots.txt Sitemap URL should be the complete URL to the Sitemap index, such as: `http://www.example.org/sitemap_index.xml.gz`
More details available in README file on GitHub.
Example 'config/sitemap.rb'
# 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
Further Documentation
Edit plugin | Back in time (9 older versions) | Last edited by: aqsalter, 8 months ago


