Skip to content

Instantly share code, notes, and snippets.

@DamianZaremba
Created May 15, 2013 19:28
Show Gist options
  • Save DamianZaremba/5586631 to your computer and use it in GitHub Desktop.
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.
# 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