viseztrance / rails-sitemap

A simple ruby on rails sitemap generator
MIT License
110 stars 24 forks source link

Adding context to file_url... #15

Closed kelseymok closed 10 years ago

kelseymok commented 10 years ago

...such that a user can additionally specify contexts to the path where the .xml should be saved, outside of the assigned host.

In some situations, we might want the sitemap.xml and sitemaps/sitemap-fragments-*.xml to live elsewhere in our file tree. The addition of :context upon load Sitemap::Generator.instance.load( :host => "www.somewhere.com", :context => "else/where" ) allows the /sitemaps directory and the sitemap.xml file to live elsewhere. This also allows for S3 implementation where a developer might house the sitemap.xml and /sitemaps directory on S3. Sitemap::Generator.instance.load( :host => "s3.amazonaws.com", :context => "some_bucket" ) so long that the real domain :host is passed when defining a literal '/some/path/here', :host => "www.mydomain.com") in the Sitemap::Generator.instance.load { ... } do block.

viseztrance commented 10 years ago

Thank you for contributing. I'll look over this and merge it over the weekend.

viseztrance commented 10 years ago

For now please link to the git version in your Gemfile. I'll update the gem (with a few other changes) some time next week.