Created
May 15, 2013 19:28
-
-
Save DamianZaremba/5586631 to your computer and use it in GitHub Desktop.
Hack to support paging at the root in Jekyll.
Looks like paginate_path should support /:num, but that breaks my jekyll install totally. This plugin patches the built in class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drop into content/_plugins/pagination.rb | |
# Outputs pages into /1/ /2/ /3/ /4/ etc | |
module Jekyll | |
module Generators | |
class Pager < Pager | |
def self.paginate_path(site_config, num_page) | |
return nil if num_page.nil? || num_page <= 1 | |
"/%d" % num_page | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment