middleman/middlemanapp.com

Sitemap Manipulators code does not show that resources needs to be returned

tommysundstrom opened this issue · 2 comments

In Custom Extensions section on Sitemap Manipulators the example code looks like this

def manipulate_resource_list(resources)
    resources.each do |resource|
      resource.destination_path.gsub!("original", "new")
    end
  end

While correct, it's in now way obvious that manipulate_resource_list must return resources. Maybe this could be made more explicit.

Good idea. This function is a reducer, we should make that clear.

Finally fixed ca65148