Skip to content

Instantly share code, notes, and snippets.

@jdlich
Created May 12, 2010 15:40
Show Gist options
  • Save jdlich/398733 to your computer and use it in GitHub Desktop.
Save jdlich/398733 to your computer and use it in GitHub Desktop.
preprocess do
def generate_gallery_pages
counter = 1
photos = Dir['assets/images/interiors/*'].
reject { |p| p.match /thumbnail/ }.
map { |p| p.gsub('assets','') }
photos.each do |photo|
site = Nanoc3::Site.new('.')
site.data_sources[0].create_item(
nil, # content
{ # attributes
:title => 'Interiors',
:section => 'interiors',
:layout => 'one',
:photo => photo,
:number => counter
},
"/interiors/#{counter}".cleaned_identifier # path
)
counter += 1
end
end
generate_gallery_pages
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment