Class: Middleman::Sitemap::Extensions::Redirects

Inherits:
ConfigExtension show all
Defined in:
lib/middleman-core/sitemap/extensions/redirects.rb

Overview

Manages the list of proxy configurations and manipulates the sitemap to include new resources based on those configurations

Defined Under Namespace

Classes: RedirectDescriptor

Constant Summary

Constants included from Contracts

Contracts::PATH_MATCHER, Contracts::ResourceList, Contracts::VectorOf

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary collapse

Methods inherited from ConfigExtension

#after_configuration, #initialize, #manipulate_resource_list, #proxy_method_call, #ready

Methods inherited from Extension

activated_extension, #add_exposed_to_context, #after_build, #after_configuration, after_extension_activated, #after_extension_activated, #before_build, #before_configuration, clear_after_extension_callbacks, config, define_setting, expose_to_application, expose_to_config, expose_to_template, global_config, helpers, #initialize, #manipulate_resource_list, option, #ready, resources

Methods included from Contracts

#Contract

Constructor Details

This class inherits a constructor from Middleman::ConfigExtension

Instance Method Details

#redirect(path, opts = {}, &block) ⇒ Object



32
33
34
# File 'lib/middleman-core/sitemap/extensions/redirects.rb', line 32

def redirect(path, opts={}, &block)
  RedirectDescriptor.new(path, opts[:to], block_given? ? block : nil)
end