middleman/middleman-core/fixtures/collections-app/config.rb
Thomas Reynolds a95dbb6367 Collections
2014-10-15 14:34:53 -05:00

16 lines
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
}