No commit activity in last 3 years
No release in over 3 years
gem sitemap_generator integration in rails_admin
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.8.1
 Project Readme

RailsAdminSitemap

Integration sitemap generators in rails_admin.

Installation

Select one of this sitemap gems and install it

https://github.com/kjvarga/sitemap_generator
gem "sitemap_generator"

https://github.com/chr1s1/dynamic_sitemaps
gem 'dynamic_sitemaps', github: "chr1s1/dynamic_sitemaps" #this fork has fix for Mongoid

https://github.com/viseztrance/rails-sitemap
gem "sitemap"

Add this line to your application's Gemfile:

gem 'rails_admin_sitemap'

And then execute:

$ bundle

Usage

RailsAdminSitemap.configure do |config|

  config.generator    = :sitemap_generator  # default; also :dynamic_sitemaps or :rails_sitemap
  config.config_file  = Rails.root.join("config", "sitemap.rb")   # default
  config.output_file  = Rails.root.join("public", "sitemap.xml")  # default for :sitemap_generator and :rails_sitemap

  # default for :dynamic_sitemaps
  config.dynamic_sitemaps_conf = {
    path: Rails.root.join("public"),
    folder: "sitemaps",
    index_file_name: "sitemap.xml"
  }
end

Configure config_file for selected gem.

Add 'sitemap' or sitemap_for_model action in config/initializers/rails_admin.rb

RailsAdmin.config do |config|

  config.actions do

    sitemap
    # or
    sitemap_for_model do
      visible do
        ['Page', 'SEO'].include? bindings[:abstract_model].model_name
      end
    end

  end

end

Action sitemap is root action, sitemap_for_model action is collection action. They do same things and so locate it wherever you want.

Features

All you need is install generator and set the config.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request