From 05218711b2c9026dfe4849d164a489afe18b205d Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Sun, 9 Jun 2013 21:08:29 +0200 Subject: [PATCH] Add warning when pagination is enabled but no template page has been found --- lib/jekyll/generators/pagination.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/generators/pagination.rb b/lib/jekyll/generators/pagination.rb index 6599aa4c..daded7b1 100644 --- a/lib/jekyll/generators/pagination.rb +++ b/lib/jekyll/generators/pagination.rb @@ -10,7 +10,14 @@ module Jekyll # # Returns nothing. def generate(site) - paginate(site, template_page(site)) if Pager.pagination_enabled?(site) + if Pager.pagination_enabled?(site) + if template = template_page(site) + paginate(site, template) + else + Jekyll.logger.warn "Pagination:", "Pagination is enabled, but I couldn't find" + + "an index.html page to use as the pagination template. Skipping pagination." + end + end end # Paginates the blog's posts. Renders the index.html file into paginated