Class: Middleman::CoreExtensions::Routing
- Inherits:
-
Middleman::ConfigExtension
- Object
- Extension
- Middleman::ConfigExtension
- Middleman::CoreExtensions::Routing
- Defined in:
- lib/middleman-core/core_extensions/routing.rb
Defined Under Namespace
Classes: PageDescriptor
Constant Summary
Constants included from Contracts
Instance Attribute Summary
Attributes inherited from Extension
Instance Method Summary collapse
Methods inherited from Middleman::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
Constructor Details
This class inherits a constructor from Middleman::ConfigExtension
Instance Method Details
#page(path, opts = {}) ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/middleman-core/core_extensions/routing.rb', line 52 def page(path, opts={}) = opts.dup page_data = .delete(:data) || {} page_data[:id] = .delete(:id) if .key?(:id) # Default layout = { locals: .delete(:locals) || {}, page: page_data, options: } PageDescriptor.new(path, ) end |