Module: Middleman::Api

Defined in:
lib/middleman-api/extension.rb,
lib/middleman-api/template.rb,
lib/middleman-api/sitemap.rb

Overview

Extension namespace

Defined Under Namespace

Modules: ClassMethods Classes: Sitemap, Template

Class Method Summary collapse

Class Method Details

.registered(app, options = {}) ⇒ Object Also known as: included

Called when extension is activated


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/middleman-api/extension.rb', line 9

def registered(app, options={})
  # Add class methods to context
  app.send :include, ClassMethods

  app.after_configuration do
    # Register json.erb template
    sitemap.register_resource_list_manipulator(:middleman_api_template, Middleman::Api::Template.new(self), false)

    # Register resource manipulator for pages with frontmatter
    sitemap.register_resource_list_manipulator(:middleman_api, Middleman::Api::Sitemap.new(self), false)
  end
end