Spree site map generator

277 views
Skip to first unread message

Kevin Kornemann

unread,
Jun 15, 2012, 12:00:48 AM6/15/12
to spree...@googlegroups.com
Hey Spree crew,

Any experienced with setting this up spree-sitemap-generator?

I followed the instructions to a tee. But before I deployed the changes to my live server I try running locally via rake task:

rake sitemap:refresh

and I get:

rake aborted!
undefined method `add_login' for #<SitemapGenerator::LinkSet:0x0000012c749d48>

This is my config/sitemap.rb file as generated after I ran "rails generate spree_sitemap_generator:install"

SitemapGenerator::Sitemap.default_host = "http://#{Spree::Config[:site_url]}"

SitemapGenerator::Sitemap.add_links do |sitemap|
  # Put links creation logic here.
  #
  # The root path '/' and sitemap index file are added automatically.
  # Links are added to the Sitemap in the order they are specified.
  #
  # Usage: sitemap.add(path, options={})
  #        (default options are used if you don't specify)
  #
  # Defaults: :priority => 0.5, :changefreq => 'weekly',
  #           :lastmod => Time.now, :host => default_host
  # 
  # 
  # Examples:
  # 
  # Add '/articles'
  #   
  #   sitemap.add articles_path, :priority => 0.7, :changefreq => 'daily'
  #
  # Add individual articles:
  #
  #   Article.find_each do |article|
  #     sitemap.add article_path(article), :lastmod => article.updated_at
  #   end
  sitemap.add_login
  sitemap.add_signup
  sitemap.add_account
  sitemap.add_password_reset
  sitemap.add_taxons
  sitemap.add_products
end

Help us Obi wan, your our only hope...


Steve Root

unread,
Jun 15, 2012, 10:14:49 AM6/15/12
to spree...@googlegroups.com
I'm using:
gem 'spree_sitemap_generator',
        :git => 'git://github.com/jdutil/spree-sitemap-generator',
        :branch => 'namespace'
with:
gem 'spree',
        :git => 'git://github.com/spree/spree.git',
        :branch => '1-1-stable'

Which I gather is a more recent fix for sitemap to work with the namespacing approach.

Kevin Kornemann

unread,
Jun 15, 2012, 10:22:47 AM6/15/12
to spree...@googlegroups.com, spree...@googlegroups.com
I'm using spree 1.0 haven't upgraded yet. But thanks I'll give it a try.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Spree" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/i09KOZBJwDoJ.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Kevin Kornemann

unread,
Jun 26, 2012, 11:05:01 AM6/26/12
to spree...@googlegroups.com
I ended up having a pro help me on this but thought I'd share for anyone else struggling with this extension.

He used this version:

gem 'spree_sitemap_generator', :git => 'git://github.com/nofolo/spree-sitemap-generator.git'

And syntax for the sitemap.rb was wrong from the generator, why I have no idea, but this is my sitemap.rb file.
  sitemap.add login_path
  sitemap.add signup_path
  sitemap.add account_path
  sitemap.add products_path
end


Hope this helps someone...

Ryan

unread,
Jul 8, 2012, 7:55:38 AM7/8/12
to spree...@googlegroups.com
Hey Kevin,

The way you have done it won't make use of the methods used in spree_defaults.rb.

I've upgraded the sitemap generator here http://github.com/wsmedia/spree-sitemap-generator to work with Spree 1.1.0.

Hope that helps.

Ryan
Reply all
Reply to author
Forward
0 new messages