jekyll-pagination 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,5 +1,12 @@
1
1
  = Revision history for jekyll-pagination
2
2
 
3
+ == 0.0.2 [2010-07-01]
4
+
5
+ * Cleanup and documentation.
6
+ * Overwriting Pagination#paginate was obsoleted by overwriting Page#dir=
7
+ * Provide aliases to original methods
8
+ * Credits.
9
+
3
10
  == 0.0.1 [2010-06-30]
4
11
 
5
12
  * Birthday :-)
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to jekyll-pagination version 0.0.1
5
+ This documentation refers to jekyll-pagination version 0.0.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -30,6 +30,12 @@ RubyGem:: <http://rubygems.org/gems/jekyll-pagination>
30
30
  * Jens Wille <mailto:jens.wille@uni-koeln.de>
31
31
 
32
32
 
33
+ == CREDITS
34
+
35
+ * Arne Eilermann <mailto:arne.eilermann@uni-koeln.de> for the original idea
36
+ and implementation.
37
+
38
+
33
39
  == LICENSE AND COPYRIGHT
34
40
 
35
41
  Copyright (C) 2010 University of Cologne,
@@ -28,33 +28,12 @@
28
28
 
29
29
  module Jekyll
30
30
 
31
- class Pagination
32
-
33
- def paginate(site, page)
34
- posts = site.site_payload['site']['posts']
35
-
36
- total = Pager.calculate_pages(posts, site.config['paginate'].to_i)
37
-
38
- 1.upto(total) { |num|
39
- pager = Pager.new(site.config, num, posts, total)
40
-
41
- if num > 1
42
- newpage = Page.new(site, site.source, page.dir, page.name)
43
-
44
- newpage.pager = pager
45
- newpage.dir = File.join(page.dir, "page#{num}")
46
-
47
- site.pages << newpage
48
- else
49
- page.pager = pager
50
- end
51
- }
52
- end
53
-
54
- end
55
-
56
31
  class Page
57
32
 
33
+ alias_method :_pagination_original_dir=, :dir=
34
+
35
+ # Overwrites the original method to also set +basename+ when there's
36
+ # a +pager+. NOTE: Depends on +pager+ being set before setting +dir+.
58
37
  def dir=(dir)
59
38
  @basename = 'index' if @pager
60
39
  @dir = dir
@@ -64,11 +43,19 @@ module Jekyll
64
43
 
65
44
  class Pager
66
45
 
67
- def self.pagination_enabled?(config, file)
68
- if config['paginate']
69
- config['paginate_files'] ||= ['index.html']
70
- config.pluralized_array('paginate_file', 'paginate_files').include?(file)
46
+ class << self
47
+
48
+ alias_method :_pagination_original_pagination_enabled?, :pagination_enabled?
49
+
50
+ # Overwrites the original method to check +paginate_file+ and
51
+ # +paginate_files+ configuration options.
52
+ def pagination_enabled?(config, file)
53
+ if config['paginate']
54
+ config['paginate_files'] ||= ['index.html']
55
+ config.pluralized_array('paginate_file', 'paginate_files').include?(file)
56
+ end
71
57
  end
58
+
72
59
  end
73
60
 
74
61
  end
@@ -6,7 +6,7 @@ module Jekyll
6
6
 
7
7
  MAJOR = 0
8
8
  MINOR = 0
9
- TINY = 1
9
+ TINY = 2
10
10
 
11
11
  class << self
12
12
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-pagination
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-30 00:00:00 +02:00
18
+ date: 2010-07-01 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21