1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/middleman-core/fixtures/collections-app/config.rb
Thomas Reynolds a95dbb6367 Collections
2014-10-15 14:34:53 -05:00

16 lines
No EOL
359 B
Ruby

collection :articles,
where: proc { |resource|
uri_match resource.url, 'blog/{year}-{month}-{day}-{title}.html'
}
collection :tags,
where: proc { |resource|
resource.data.tags
},
group_by: proc { |resource|
if resource.data.tags.is_a? String
resource.data.tags.split(',').map(&:strip)
else
resource.data.tags
end
}