pagination executable option

This commit is contained in:
David Calavera 2009-04-04 14:46:44 +02:00
parent f099d00cb0
commit 2e00c5957b
1 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,16 @@ opts = OptionParser.new do |opts|
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
options['permalink'] = style unless style.nil?
end
opts.on("--paginate [POSTS_PER_PAGE]", "Paginate a blog's posts") do |per_page|
begin
options['paginate'] = per_page.to_i
raise ArgumentError if options['paginate'] == 0
rescue
puts 'you must specify a number of posts by page bigger than 0'
exit 0
end
end
opts.on("--version", "Display current version") do
puts "Jekyll " + Jekyll.version