Class: Middleman::CoreExtensions::Routing

Inherits:
Middleman::ConfigExtension show all
Defined in:
middleman-core/lib/middleman-core/core_extensions/routing.rb

Defined Under Namespace

Classes: PageDescriptor

Constant Summary

Constants included from Contracts

Contracts::ImmutableSetOf, Contracts::ImmutableSortedSetOf, Contracts::OldResourceList, Contracts::PATH_MATCHER, Contracts::ResourceList, Contracts::VectorOf

Instance Attribute Summary

Attributes inherited from Extension

#app, #options

Instance Method Summary collapse

Methods inherited from Middleman::ConfigExtension

#after_configuration, #initialize, #manipulate_resource_list_container!, #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

#page(path, options_hash = ::Middleman::EMPTY_HASH) ⇒ Object


62
63
64
65
66
67
68
69
# File 'middleman-core/lib/middleman-core/core_extensions/routing.rb', line 62

def page(path, options_hash = ::Middleman::EMPTY_HASH)
  options = options_hash.dup

  page_data = options.delete(:data) || {}
  page_data[:id] = options.delete(:id) if options.key?(:id)

  PageDescriptor.new(path, options.delete(:locals), page_data, options)
end