# Need help preparing a 'Sitemap.xml' file using a Rake

**URL:** <https://www.ruby-forum.com/t/need-help-preparing-a-sitemap-xml-file-using-a-rake/140593>\
**Category:** Rails\
**Created:** [June 16, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/need-help-preparing-a-sitemap-xml-file-using-a-rake/140593 "2008-06-16T16:54:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 16, 2008, 4:54pm UTC](https://www.ruby-forum.com/t/need-help-preparing-a-sitemap-xml-file-using-a-rake/140593/1 "2008-06-16T16:54:07Z")

</div>

After having my websites up for a few months and wondering why my  
content is not exposed through search engines, I discovered SITEMAPS!  
I’ve done a Google for explanations of how this is accomplished and  
found these links;

[http://www.igvita.com/2006/11/24/google-yahoo-sitemaps-in-rails/](http://www.igvita.com/2006/11/24/google-yahoo-sitemaps-in-rails/)  
[http://scoop.cheerfactory.co.uk/2008/02/26/google-sitemap-generator/](http://scoop.cheerfactory.co.uk/2008/02/26/google-sitemap-generator/)  
[http://harrylove.org/2008/06/10/google-sitemaps-with-ruby-on-rails-capistrano-and-cron#comment-245](http://harrylove.org/2008/06/10/google-sitemaps-with-ruby-on-rails-capistrano-and-cron#comment-245)  
[http://tonycode.com/wiki/index.php?title=Ruby\_on\_Rails\_Sitemap\_Generator](http://tonycode.com/wiki/index.php?title=Ruby_on_Rails_Sitemap_Generator)

These are either not current Rails 2.? explanations or are too  
esoteric for me to follow.

I’ve written the logic to travel through my database and build the  
various links but I don’t know how to;

1. Write this into a Rake task
2. deliver the output to a xml file
3. format the xml file to behave the way Google wants

My plan is to download the data files from my website onto my desktop  
computer. Run the Rake procedure and then simply upload the  
sitemap\_??.xml files.  
Hopefully, someone could teach me how to build the index file to  
compliment these.

I’m ‘between a rock and a hard place’ on this one and am willing to  
pay someone for guidance.  
Thanks,  
Kathleen  
removed\_email\_address@domain.invalid
