Since I recently restructured my site I wanted to make changes quickly visible to Google. Sitemaps can help with this. I searched for Mephisto plugin. Found Sitemap Generator by Joseph Moore and Auto Generated Sitemaps by Greg Benedict.

Both were great but required manually editing Rails routes. They also did not use Mephistos plugin facilities which enable configuring through admin interface.

Based from two previous examples Mephisto Sitemap was born. Installing is as simple as:

script/plugin install 
http://svn.appelsiini.net/svn/rails/plugins/mephisto_sitemap/

Restart you WEBrick or mongrel and youre set to go. Routes are automatically added to poing to your <mephisto_root>/sitemap.xml.

Now sit back and wait for you increased Google fame!

8 Responses to “Mephisto Google Sitemaps Plugin”

  1. Martin Maciaszek Says:

    I just installed mephisto_sitemap in my mephisto blog. Unfortunately whenever I try to request /sitemap.xml I get this error:

    NoMethodError in SitemapController#index

    undefined method `is_missing?’ for #<loaderror:0x34934c0>

    vendor/rails/actionpack/lib/action_controller/helpers.rb:130:in `default_helper_module!’ vendor/rails/actionpack/lib/action_controller/helpers.rb:143:in `send’ vendor/rails/actionpack/lib/action_controller/helpers.rb:143:in `inherited_without_api’ /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.2.3/lib/action_web_service/container/action_controller_container.rb:84:in `inherited_without_action_controller’ /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-1.2.3/lib/action_web_service/dispatcher/action_controller_dispatcher.rb:32:in `inherited’ app/controllers/application.rb:10:in `inherited’

    I am running mephisto edge and rails edge.

  2. Mika Tuupola Says:

    I am running 1.2.1 and 1.2.3 Rails and Mephisto edge. Might be related to edge Rails. Will do a test setup with edge Rails and investigate.

  3. Mika Tuupola Says:

    Could you reinstall and test. Patch was kindly provided by Sean O’Brien.

    script/plugin install --force 
    http://svn.appelsiini.net/svn/rails/plugins/mephisto_sitemap/

    Problem was that helper file did not define SitemapHelper module. This caused edge Rails to throw exception.

  4. face Says:

    Hello,

    Just got your plugin working with edge rails on edge mephisto (i.e. rails 2.0).

    Couple things: 1) lib/sitemap_controller has a depricated refrence to template_root (which rails 2 replaces with view_paths. So changing line 2 to self.view_paths = File.join(File.dirname(FILE),’../’, ‘views’) fixes the problem for rails edge.

    2) Could get the auto route to work. Adding a manual route to lib/mephisto/routing worked and I didn’t investigate further.

  5. Mika Tuupola Says:

    Face, thanks! Seems I have some debugging to do with edge rails…

  6. John Says:

    Can you give me the exact fix for part 2 above? I’m a bit of a newbie with mephisto… Thanks!

  7. Thibaut Barrère Says:

    Hi Mika,

    I want to say thank you for your plugin. I’m using it with Mephisto trunk and Rails 2.0.2: it works great.

    thanks!

    —Thibaut

  8. Mika Tuupola Says:

    face & john: I committed the fixes. Everything now works out of the box with Rails 2.0.2 and Mephisto 0.8. This includes automatic adding of route.

     script/plugin install --force
     http://svn.appelsiini.net/svn/rails/plugins/mephisto_sitemap/
    
    Thibaut: Thanks! You might want to upgrade too. Latest version silences some warnings which were logged.

Leave a Reply