
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
A simple ruby on rails sitemap generator.
Install the gem:
gem install sitemap
Or as a plugin:
rails plugin install git://github.com/viseztrance/rails-sitemap.git
Then create the initial config file:
rails g sitemap:install
In your sitemap config file, paths can be indexed as follows:
Sitemap::Generator.instance.load :host => "mywebsite.com" do
path :root, :priority => 1
path :faq, :priority => 0.5, :change_frequency => "weekly"
literal "/my_blog" #helpful for vanity urls layering search results
resources :activities, :params => { :format => "html" }
resources :articles, :objects => proc { Article.published }
end
Please read the docs for a more comprehensive list of options.
Building the sitemap:
rake sitemap:generate
By default the sitemap gets saved in the current application root path. You can change the save path by passing a LOCATION environment variable or using a configuration option:
Sitemap.configure do |config|
config.save_path = "/home/user/apps/my-app/shared"
end
Ping search engines:
rake sitemap:ping
You may change the defaults for either params or search options as follows:
Sitemap.configure do |config|
config.params_format = "html"
config.search_change_frequency = "monthly"
end
Google imposes a limit of 50000 entries per sitemap and maximum size of 10 MB. To comply with these rules, sitemaps having over 10.000 urls are being split into multiple files. You can change this value by overriding the max urls value:
Sitemap.configure do |config|
config.max_urls = 50000
end
This package is licensed under the MIT license and/or the Creative Commons Attribution-ShareAlike.
FAQs
Unknown package
We found that sitemap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.