Skip to content

solidusio-contrib/solidus_sitemap

Solidus Sitemap

Build Status

Solidus Sitemap is a sitemap generator based on the sitemap_generator gem. It adheres to the Sitemap 0.9 protocol specification.

Capabilities

  • Adheres to the 0.9 Sitemap protocol specification
  • Notifies search engines of new sitemap versions
  • Supports large product catalogs
  • Compresses sitemaps with gzip
  • Allows you to easily add additional sitemaps for custom pages in your site
  • Supports Amazon S3 and other hosting services

Installation

First of all, add the gem to your store's Gemfile:

gem 'solidus_sitemap', github: 'solidusio-contrib/solidus_sitemap'

Bundle your dependencies:

$ bundle install

Run the installer, which will create a config/sitemap.rb file with some sane defaults:

$ rails g solidus_sitemap:install

Set up a cron job to regenerate your sitemap via the rake sitemap:refresh task. If you use the Whenever gem, add this to your config/schedule.rb:

every 1.day, at: '5:00 am' do
 rake '-s sitemap:refresh'
end

Ensure crawlers can find the sitemap by adding the following line to your public/robots.txt with your own domain:

$ echo "Sitemap: http://www.example.com/sitemap.xml.gz" >> public/robots.txt

Upgrading

If you're upgrading from early versions of solidus_sitemap, you need to change your sitemaps from this:

SitemapGenerator::Sitemap.add_links do
  # ...
end

To this:

SitemapGenerator::Sitemap.create do
  # ...
end

Configuration

Check out the readme of the sitemap_generator gem.

Contributing

Releasing new versions

1. Bump gem version and push to RubyGems

We use gem-release to release this extension with ease.

Supposing you are on the master branch and you are working on a fork of this extension, upstream is the main remote and you have write access to it, you can simply run:

gem bump --version minor --tag --release

This command will:

  • bump the gem version to the next minor (changing the version.rb file)
  • commit the change and push it to upstream master
  • create a git tag
  • push the tag to the upstream remote
  • release the new version on RubyGems

Or you can run these commands individually:

gem bump --version minor
gem tag
gem release

2. Publish the updated CHANGELOG

After the release is done we can generate the updated CHANGELOG using github-changelog-generator by running the following command:

bundle exec github_changelog_generator solidusio/solidus_sitemap --token YOUR_GITHUB_TOKEN
git commit -am 'Update CHANGELOG'
git push upstream master

Acknowledgements

License

Nebulab

Copyright (c) 2019 Nebulab.

Copyright (c) 2016-2018 Stembolt.

Copyright (c) 2011-2015 Jeff Dutil and other contributors, released under the New BSD License.