Module: Middleman::Navigation

Defined in:
lib/middleman-navigation.rb,
lib/middleman-navigation/tree.rb,
lib/middleman-navigation/version.rb,
lib/middleman-navigation/resource_list_manipulator.rb

Defined Under Namespace

Classes: ResourceListManipulator, Tree

Constant Summary collapse

FRONTMATTER_DEFAULTS =
{
  hidden: false,
  title: nil,
  destination: nil,
  weight: 0,
}.with_indifferent_access
VERSION =
"1.0.4"

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object Also known as: included



22
23
24
25
26
27
28
29
30
31
# File 'lib/middleman-navigation.rb', line 22

def registered(app)
  # Make a reference to the app on our patched simple-navigation Sinatra 
  # adapter so we can use the app's settings for proper URLs.
  SimpleNavigation::Adapters::Sinatra.middleman_app = app

  app.helpers SimpleNavigation::Helpers
  app.ready do
    sitemap.register_resource_list_manipulator :navigation, ResourceListManipulator.new(sitemap)
  end
end