middleman/middleman-core/fixtures/collections-app/config.rb

16 lines
359 B
Ruby
Raw Normal View History

2014-06-29 00:07:43 +02:00
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
}