Hi,
I did a quick Google search and didn't see anything super-great to automate creation and updating of my google sitemap for the ruby on rails app. Any suggestions?
Hi,
I did a quick Google search and didn't see anything super-great to automate creation and updating of my google sitemap for the ruby on rails app. Any suggestions?
Hello,
I really wouldn't recommend using controller and simply routing to it like '/sitemap.xml', because if your sitemaps will grow it will waste resourses. It would be best to make a rake task and regenerate sitemaps every night or so, depending on how frequently the content changes.
If your site does not have anywhere near 50000 pages and you're not planing to have more then you can fit in one sitemap file then I suggest you use "Google Sitemaps with Ruby on Rails, Capistrano, and Cron" I know it works decently because I'm using it sucessfully atm.
Note: I would not suggest using authors way of copying sitemaps every time when deployment task is run, in my opinion it's not clean. It's better to use shared directory and symlink to it on deployment, then you'll be sure to have only one version of files and now wasting space if extra copies get left behind. I have this in my deploy.rb:
desc "Symlink the upload directories"
task :before_symlink do
run "rm -drf #{release_path}/public/sitemaps"
run "ln -s #{shared_path}/sitemaps #{release_path}/public/sitemaps"
end
Also you can use "Big sitemap" gem, but I have found it just now and can't tell you how good it is. It looks like it's really easy to setup this gem and it also uses your rails routes for link generation, so you'll have one problem less to solve than with the first solution.
The Google Sitemap Generator is Google's official release. It's easy to set up and configure.