lib/jekyll/generators/pagination.rb in jekyll-0.11.2 vs lib/jekyll/generators/pagination.rb in jekyll-0.12.0

- old
+ new

@@ -35,16 +35,22 @@ (1..pages).each do |num_page| pager = Pager.new(site.config, num_page, all_posts, pages) if num_page > 1 newpage = Page.new(site, site.source, page.dir, page.name) newpage.pager = pager - newpage.dir = File.join(page.dir, "page#{num_page}") + newpage.dir = File.join(page.dir, paginate_path(site, num_page)) site.pages << newpage else page.pager = pager end end end + + private + def paginate_path(site, num_page) + format = site.config['paginate_path'] + format.sub(':num', num_page.to_s) + end end class Pager attr_reader :page, :per_page, :posts, :total_posts, :total_pages, :previous_page, :next_page