pagination executable option
This commit is contained in:
parent
f099d00cb0
commit
2e00c5957b
10
bin/jekyll
10
bin/jekyll
|
@ -52,6 +52,16 @@ opts = OptionParser.new do |opts|
|
|||
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
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue