Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Sitemap

Sitemap

= MephistoGoogleSiteMap

The Mephisto Google SiteMap Plugin creates an XML sitemap using Google’s SiteMap protocol (http://www.google.com/webmasters/sitemaps/docs/en/protocol.html) out of your sites data.

Installation

Add the following inside your Routes.draw block in routes.rb:

MephistoGoogleSiteMap.connect_with map

There is one module attribute in the MephistoGoogleSiteMap module you definitely want to set:

@@site_uri # this is your site's root url

Other optional attributes you can change in MephistoGoogleSiteMap to affect how you inform google to index your site are:

@@home_frequency    # the frequency of indexing your home page (plugin default is daily)
@@blog_frequency    # the frequency of indexing a blog based page (plugin default is daily)
@@page_frequency    # the frequency of indexing a page page (plugin default is weekly)
@@home_priority     # priority of your sites index page to google's bot (plugin default is 0.9)
@@article_priority  # priority of all other pages to google's bot (plugin default is 0.5)

To learn more about the values and properties the constants represent, see:

http://www.google.com/webmasters/sitemaps/docs/en/protocol.html

Don’t Forget to Sign up!

finally, for any of this to be useful, you’ll want to sign up for Google’s Webmaster tools to notify them of the presence of your sitemap (which will be at http://your.domain.com/sitemap.xml) here:

http://www.google.com/webmasters/sitemaps/

CAVEATS

1. the google sitemap plugin folder needs to fall, alphabetically after the simply_helpful plugin (due to a lack of sophistication in rails plugin loading and the fact that simply_helpful won't load properly if the application controller gets instantiated before it's triggered). Renaming the plugin to `sitemap` seems sufficient and effective.

2. in config/routes.rb, the MephistoGoogleSitemap routing must come first, so:

ActionController::Routing::Routes.draw do |map|
  MephistoGoogleSiteMap.connect_with map
  Mephisto::Routing.connect_with map
end

Otherwise, Mephistos catch-all route will swallow the request before it gets to the plugin.

LICENSE

The terms of the BSD License have been utilized (see LICENSE)

==BUGS

Please report all bugs and/or submit patches to: scaudill at gmail dot com

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly

Users


See all details


Membership

+ Join this railsplugin

Record Maintainer

'None'