Method: Middleman::Extension#manipulate_resource_list
- Defined in:
- lib/middleman-core/extension.rb
#manipulate_resource_list(resources) ⇒ Array<Sitemap::Resource>
Note:
This method must return the full set of resources, because its return value will be used as the new sitemap.
Manipulate the resource list by transforming or adding Sitemap::Resources. Sitemap manipulation is a powerful way of interacting with a project, since it can modify each Sitemap::Resource or generate new Sitemap::Resources. This method is used in a pipeline where each sitemap manipulator is run in turn, with each one being fed the output of the previous manipulator. See the source of built-in Middleman extensions like Middleman::Extensions::DirectoryIndexes and Middleman::Extensions::AssetHash for examples of how to use this.
355 356 357 358 359 |
# File 'lib/middleman-core/extension.rb', line 355 def add_exposed_to_context(context) (self.class.exposed_to_template || {}).each do |k, v| context.define_singleton_method(k, &method(v)) end end |