Print warning when `paginate` is set to `true`.

Related to #1105.

Sample output:
~/code/jekyll/tsite$ ../bin/jekyll build --trace
Configuration file: /Users/parker/code/jekyll/tsite/_config.yml
    Config Warning: The `paginate` key must be a positive integer or nil. It's currently set to 'true'.
            Source: /Users/parker/code/jekyll/tsite
       Destination: /Users/parker/code/jekyll/tsite/_site
      Generating... done.
This commit is contained in:
Parker Moore 2013-08-06 20:56:29 +02:00
parent 8f7e229e8c
commit 6eec3a7942
1 changed files with 13 additions and 1 deletions

View File

@ -150,7 +150,7 @@ module Jekyll
$stderr.puts "#{err}"
end
configuration.backwards_compatibilize
configuration.fix_common_issues.backwards_compatibilize
end
# Public: Split a CSV string into an array containing its values
@ -205,5 +205,17 @@ module Jekyll
config
end
def fix_common_issues
config = clone
if config.has_key?('paginate') && (!config['paginate'].is_a?(Integer) || config['paginate'] < 0)
Jekyll.logger.warn "Config Warning:", "The `paginate` key must be a" +
" positive integer or nil. It's currently set to '#{config['paginate'].inspect}'."
config['paginate'] = nil
end
config
end
end
end