class Middleman::Sitemap::Extensions::Redirects::RedirectManager
to include new resources based on those configurations
Manages the list of proxy configurations and manipulates the sitemap
def create_redirect(path, opts={}, &block)
-
(void)
-
Parameters:
-
The
(Hash
) -- :to value gives a target path -
path
(String
) --
def create_redirect(path, opts={}, &block) if block_given? opts[:template] = block end @redirects[path] = opts @app.sitemap.rebuild_resource_list!(:added_redirect) end
def initialize(app)
def initialize(app) @app = app @redirects = {} end
def manipulate_resource_list(resources)
-
(void)
-
def manipulate_resource_list(resources) resources + @redirects.map do |path, opts| r = RedirectResource.new( @app.sitemap, path, opts[:to] ) r.output = opts[:template] if opts[:template] r end end