Perform jekyll-paginate deprecation warning correctly.

Fixes #3393
This commit is contained in:
Parker Moore 2015-03-16 14:54:31 -07:00
parent b6424c9197
commit bb57c80478
2 changed files with 10 additions and 5 deletions

View File

@ -262,11 +262,6 @@ module Jekyll
"be removed in 3.0.0. We recommend you switch to Kramdown."
end
if config.key?('paginate') && config['paginate'] && !(config['gems'] || []).include?('jekyll-paginate')
Jekyll::Deprecator.deprecation_message "You appear to have pagination " +
"turned on, but you haven't included the `jekyll-paginate` gem. " +
"Ensure you have `gems: [jekyll-paginate]` in your configuration file."
end
config
end

View File

@ -17,6 +17,7 @@ module Jekyll
def conscientious_require
require_plugin_files
require_gems
deprecation_checks
end
# Require each of the gem plugins specified.
@ -88,5 +89,14 @@ module Jekyll
end
end
def deprecation_checks
pagination_included = (!(site.config['gems'] || []).include?('jekyll-paginate') || !defined?(Jekyll::Paginate))
if site.config['paginate'] && pagination_included
Jekyll::Deprecator.deprecation_message "You appear to have pagination " +
"turned on, but you haven't included the `jekyll-paginate` gem. " +
"Ensure you have `gems: [jekyll-paginate]` in your configuration file."
end
end
end
end