Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- preprocess do
- # Find items to put in archives
- items_to_archive = items.select { |i| i.identifier =~ /^\/files/ }
- # Group them by extension
- item_groups = items_to_archive.group_by { |i| i[:extension] }
- # For each extension (and their items)...
- item_groups.each_pair do |extension, items|
- # ... create a new item
- items << Nanoc3::Item.new(
- '',
- { :identifiers => items.map { |i| i.identifier } },
- "/archives/#{extension}.tar.bz2"
- )
- end
- compile '/archives/*/' do
- filter :tar
- end
- route '/archives/*/' do
- item.identifier.chop + '.tar.b2'
- end
Add Comment
Please, Sign In to add comment