Permalink
Browse files

Enable custom permalinks with an alternative paginate_file. (hopefull…

…y this is the right repo ;))
  • Loading branch information...
1 parent 60ebbe8 commit ebece67392ef7a88d305be29586238bedc5909dc Arne Eilermann committed Sep 3, 2010
Showing with 21 additions and 1 deletion.
  1. +12 −1 README
  2. +9 −0 lib/jekyll/pagination.rb
View
13 README
@@ -13,7 +13,18 @@ Add the following to your <tt>_plugins/ext.rb</tt> file:
require 'jekyll-pagination'
-Then set +paginate_file+ or +paginate_files+ in your <tt>_config.yml</tt>.
+Then set +paginate_file+ or +paginate_files+ in your <tt>_config.yml</tt> like:
+
+ paginate: 10
+ paginate_file: blog.html
+
+or
+
+ paginate: 10
+ paginate_files:
+ - blog.html
+ - projects.html
+
The default is to paginate the <tt>index.html</tt> file.
View
@@ -39,6 +39,15 @@ def dir=(dir)
@dir = dir
end
+ alias_method:_pagination_original_index?, :index?
+
+ # Overwrites the original method to also include the configured
+ # paginate file(s) in the evaluation.
+ def index?
+ # basename == @site.config['paginate_file'].sub('.html', '')
+ [@site.config['paginate_file']].flatten.map { |f| f.sub('.html', '') }.include?(basename)
+ end
+
end
class Pager

0 comments on commit ebece67

Please sign in to comment.