added command-line option --paginate_path
This commit is contained in:
parent
2b8017dfdc
commit
58d8fef7ec
16
bin/jekyll
16
bin/jekyll
|
@ -102,7 +102,7 @@ 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
|
||||
|
@ -113,6 +113,16 @@ opts = OptionParser.new do |opts|
|
|||
end
|
||||
end
|
||||
|
||||
opts.on("--paginate_path [PAGINATED_URL_FORMAT]", "Leave blank for /page<num>") do |paginate_path|
|
||||
begin
|
||||
options['paginate_path'] = paginate_path
|
||||
raise ArgumentError if options['paginate_path'].nil?
|
||||
rescue
|
||||
puts 'You must specify a pagination url format'
|
||||
exit 0
|
||||
end
|
||||
end
|
||||
|
||||
opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts|
|
||||
begin
|
||||
options['limit_posts'] = limit_posts.to_i
|
||||
|
@ -148,12 +158,12 @@ if ARGV.size > 0
|
|||
else
|
||||
migrator = migrator.downcase
|
||||
end
|
||||
|
||||
|
||||
cmd_options = []
|
||||
['file', 'dbname', 'user', 'pass', 'host', 'site'].each do |p|
|
||||
cmd_options << "\"#{options[p]}\"" unless options[p].nil?
|
||||
end
|
||||
|
||||
|
||||
# It's import time
|
||||
puts "Importing..."
|
||||
|
||||
|
|
Loading…
Reference in New Issue