Class: Middleman::Api::Template

Inherits:
Object
  • Object
show all
Defined in:
lib/middleman-api/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Template

Returns a new instance of Template.


3
4
5
6
7
8
# File 'lib/middleman-api/template.rb', line 3

def initialize(app)
  @app = app
  @app.after_configuration do
    api_formats.each {|f| ignore "api.#{f}"} 
  end
end

Instance Method Details

#manipulate_resource_list(resources) ⇒ void

This method returns an undefined value.

Update the main sitemap resource list


12
13
14
15
16
17
18
# File 'lib/middleman-api/template.rb', line 12

def manipulate_resource_list(resources)
  templates = []
  @app.api_formats.each do |f|
    templates << ::Middleman::Sitemap::Resource.new(@app.sitemap, "api.#{f}", template(f))
  end
  resources + templates
end