Hi, I’d like to automatically generate gallery pages for my website. I created a galleries.yml file in the data directory which is structured as follows:
galleries:
- name: g1
date: 2014-02-01
location: "images/2014-02-01-g1/"
- name: g2
date: 2014-04-20
location: "images/2014-04-20-g2/"
What I’m trying to do is to create a set of dynamic pages from this data. In config.rb I added the following code in order to generate said pages:
ready do
data.galleries.galleries.each do |gallery|
proxy "galleries/#{gallery.name}.html", "gallery.html", :locals => { :gallery => gallery }, :ignore => true
end
end
Now, from the gallery.html.erb template I’d like to access all the resources found in the specified location of a given gallery entry. Something like this:
<% sitemap.find_resources_by_path("#{gallery.location}").each do |image| %>
<p><%= image.url %></p>
<% end %>
The method find_resources_by_path doesn’t exist but this is the functionality I need: a way to get all the resources in a specified path. Is that possible?
Thank you very much.