Skip to content

Commit

Permalink
Print warning when paginate is set to true.
Browse files Browse the repository at this point in the history
Related to jekyll#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.
  • Loading branch information
parkr committed Aug 6, 2013
1 parent 8f7e229 commit 6eec3a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/jekyll/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def read_config_files(files)
$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
Expand Down Expand Up @@ -205,5 +205,17 @@ def backwards_compatibilize
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

0 comments on commit 6eec3a7

Please sign in to comment.