lib/middleman-alias/extension.rb in middleman-alias-0.0.8 vs lib/middleman-alias/extension.rb in middleman-alias-0.0.9

- old
+ new

@@ -8,22 +8,24 @@ end def manipulate_resource_list(resources) resources.each do |resource| if resource.data["alias"] - alias_url = resource.data["alias"] - alias_url += "index.html" if alias_url.match(/\/$/) - existing_resource = resources.select{|r| r.destination_path == alias_url }.first - next if existing_resource + Array(resource.data["alias"]).each do |mm_alias| + alias_url = mm_alias + alias_url += "index.html" if alias_url.match(/\/$/) + existing_resource = resources.select{|r| r.destination_path == alias_url }.first + next if existing_resource - resources.push Middleman::Sitemap::AliasResource.new(@app.sitemap, alias_url, resource.url) - #Sitemap::Resource.new(@app.sitemap, alias_url).tap do |p| - #p.proxy_to("alias.html") - #p.add_metadata locals: { - #destination: resource.url - #} - #resources.push p - #end + resources.push Middleman::Sitemap::AliasResource.new(@app.sitemap, alias_url, resource.url) + #Sitemap::Resource.new(@app.sitemap, alias_url).tap do |p| + #p.proxy_to("alias.html") + #p.add_metadata locals: { + #destination: resource.url + #} + #resources.push p + #end + end end end resources end