pagination executable option
This commit is contained in:
parent
f099d00cb0
commit
2e00c5957b
10
bin/jekyll
10
bin/jekyll
|
@ -51,6 +51,16 @@ opts = OptionParser.new do |opts|
|
||||||
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
|
opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
|
||||||
options['permalink'] = style unless style.nil?
|
options['permalink'] = style unless style.nil?
|
||||||
end
|
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
|
opts.on("--version", "Display current version") do
|
||||||
puts "Jekyll " + Jekyll.version
|
puts "Jekyll " + Jekyll.version
|
||||||
|
|
Loading…
Reference in New Issue