public
Description: A Rails plugin to create sitemaps
Homepage: http://labs.3dglabs.com.ar/projects/show/has-sitemap
Clone URL: git://github.com/Gazer/has_sitemap.git
Gazer (author)
Sun Jun 22 12:37:58 -0700 2008
name age message
file .gitignore Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file MIT-LICENSE Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file README Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file Rakefile Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file init.rb Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file install.rb Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
directory lib/ Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
directory tasks/ Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
directory test/ Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
file uninstall.rb Sun Jun 22 12:37:58 -0700 2008 Initial version [Gazer]
README
=HasSitemap

This plugin allow your sites provide in an easy way sitemap and/or sitemaps index to 
improve search engine indexing.

For more details about the sitemap protocol see [1]

=Example

For sitemap :
  controller MyController::ActiveController::Base
    has_sitemap :data => :my_func

    def index
    end

    # Others public methods

    private
    def my_func
      # Create sitemap array
    end
  end

The my_func function must return an array of hashes, where each hash contains the keys :
loc, lastmod, priority (optional), changefreq (optional). The changefreq must be a valid value
as described in [1].

The plugin add an aditional method to help in the array construction, called sitemap_entry.
See the docs for more details.

For sitemap_index :
  controller MyController::ActiveController::Base
    has_sitemap_index :data => :my_func

    def index
    end

    # Others public methods

    private
    def my_func
      # Create sitemap array
    end
  end

The value returned by my_func is the same as described for has_sitemap, with loc and loatmod (optional)
has keys for each item.


To access to your sitemap or sitemap_index just use :
  http://localhost:3000/my/sitemap.xml
  http://localhost:3000/my/sitemap_index.xml

=TODO
* A Sitemap can't have more than 50k entries, the plugnin have handle this for large sites
* GZipped sitemaps

=References

[1] http://www.sitemaps.org/protocol.php

Copyright (c) 2008 Ricardo Markiewcz <richard@3dgames.com.ar>, released under the MIT license