I wrote a sitemap plugin for rails yesterday. This plugin will
generate the public/sitemap.xml from config/sitemap.rb whose format is
very familiar to config/routes.rb.
I think it is very helpful if you have a website written by rails and
want it to be crawled by spiders such as google, yahoo and baidu.
The home page of the plugin is
The following codes is the config/sitemap.rb using in my website
Sitemap::Routes.host = ‘http://www.huangzhimin.com’
Sitemap::Routes.draw do |map|
map.resources :categories, :except => [‘index’, ‘show’] do |
category.resources :posts, :except => ‘show’
map.resources :tags, :except => [‘index’, ‘show’] do |tag|
tag.resources :entries, :except => ‘show’
map.root :controller => ‘pasters’, :action => ‘index’
You can see the generated sitemap.xml in
and this sitemap.xml is successfully submitted to google.
Hope it is useful to you!