Hello,
In the config.rb file I have created a proxy for all category values:
data.categories.collect{|categories| categories}.each do |category|
proxy "/categories/#{category.name.gsub(" ", "_")}.html", "/categories/category_template.html", :locals => {:category => category}, :ignore => true
end
Then, on the main page, I would like to create a link to each of these categories. Instead of building the link url myself again from the categories in the data object, I would like to get the url and name from the list of site resources. I do the following in index.html.haml:
- sitemap.resources.select{|p| p.destination_path.include?('categories/')}.each do |p|
%li.list-group-item
= p.locals
But here following error is thrown:
NoMethodError at /
undefined method `locals' for #<Middleman::Sitemap::Resource:0x007ffc2be229d8>
Could someone please assist and tell me why this isn’t working? Am I doing something wrong?
According to the API the ‘locals’ field should be accessible: http://www.rubydoc.info/github/middleman/middleman/Middleman/Sitemap/Resource
Or is this locals field not available on all locations?
Thanks in advance for any input.