
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
SitemapBuilder is a rail plugin for sitemap generation. It is heavily based on Adam Salter's Sitemap Generator plugin (git://github.com/adamsalter/sitemap_generator.git).
This plugin is not a fork of Adam's plugin but a complete rewriting since the goal and the way to build sitemap is different.
Indeed, I wanted a way to build seveal sitemap for the same website depending on some paramters such as the site language (see file sitemap_example.rb).
no gem for now.
script/plugin install git://github.com/franck/sitemap-builder.git
Create a sitemap.rb file in config/
Create a sitemap instance:
sitemap = SitemapBuilder::Sitemap.new(
:debug => true,
:host => "http://localhost:3000",
:filename => "sitemap.yml",
:ping_search_engines => true
)
sitemap.add root_path
sitemap.add pages_path
Page.all.each do |page|
sitemap.add page_path(page)
end
sitemap.add url_for(:controller => "articles", :action => "index", :only_path => true)
Then add the following lines for the sitemap generation and ping search engines (if set to true):
sitemap.generate
sitemap.ping_search_engines
Then, fire the rake task :
rake sitemapbuilder:create
I use whenever gem (git://github.com/javan/whenever.git) to schedule a new sitemap creation :
every 1.week do
rake "sitemapbuilder:create"
end
A complete example file is available inside the plugin root directory : sitemap_example.rb
A sitemap index builder is also provided. Example of config/sitemap.rb:
sitemap_index = SitemapBuilder::SitemapIndex.new() sitemap = SitemapBuilder::Sitemap.new() sitemap.add root_path sitemap_index.sitemaps << sitemap sitemap_index.generate
These lines create a sitemap.xml file and a sitemap_index.xml file in the public directory.
SitemapBuilder::Sitemap accepts several options :
Copyright (c) 2009 Franck D'agostini, released under the MIT license
FAQs
Unknown package
We found that sitemap-builder 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.