jekyll-pagination 0.0.2 → 0.0.3
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 +4 -0
- data/README +13 -2
- data/Rakefile +7 -1
- data/lib/jekyll/pagination.rb +14 -4
- data/lib/jekyll/pagination/version.rb +1 -1
- metadata +5 -5
data/ChangeLog
CHANGED
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to jekyll-pagination version 0.0.
|
5
|
+
This documentation refers to jekyll-pagination version 0.0.3
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -13,7 +13,18 @@ Add the following to your <tt>_plugins/ext.rb</tt> file:
|
|
13
13
|
|
14
14
|
require 'jekyll-pagination'
|
15
15
|
|
16
|
-
Then set +paginate_file+ or +paginate_files+ in your <tt>_config.yml</tt
|
16
|
+
Then set +paginate_file+ or +paginate_files+ in your <tt>_config.yml</tt> like:
|
17
|
+
|
18
|
+
paginate: 10
|
19
|
+
paginate_file: blog.html
|
20
|
+
|
21
|
+
or
|
22
|
+
|
23
|
+
paginate: 10
|
24
|
+
paginate_files:
|
25
|
+
- blog.html
|
26
|
+
- projects.html
|
27
|
+
|
17
28
|
The default is to paginate the <tt>index.html</tt> file.
|
18
29
|
|
19
30
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,13 @@ begin
|
|
14
14
|
}
|
15
15
|
}}
|
16
16
|
rescue LoadError
|
17
|
-
|
17
|
+
warn "Please install the `hen' gem."
|
18
18
|
end
|
19
19
|
|
20
20
|
### Place your custom Rake tasks here.
|
21
|
+
|
22
|
+
begin
|
23
|
+
require 'jekyll/testtasks/rake'
|
24
|
+
rescue LoadError
|
25
|
+
warn "Please install the `jekyll-testtasks' gem."
|
26
|
+
end
|
data/lib/jekyll/pagination.rb
CHANGED
@@ -39,21 +39,31 @@ module Jekyll
|
|
39
39
|
@dir = dir
|
40
40
|
end
|
41
41
|
|
42
|
+
alias_method :_pagination_original_index?, :index?
|
43
|
+
|
44
|
+
# Overwrites the original method to also include the configured
|
45
|
+
# paginate file(s) in the evaluation.
|
46
|
+
def index?
|
47
|
+
Pager.paginate_files(@site.config).include?("#{basename}.html")
|
48
|
+
end
|
49
|
+
|
42
50
|
end
|
43
51
|
|
44
52
|
class Pager
|
45
53
|
|
46
54
|
class << self
|
47
55
|
|
56
|
+
def paginate_files(config)
|
57
|
+
config['paginate_files'] ||= ['index.html']
|
58
|
+
config.pluralized_array('paginate_file', 'paginate_files')
|
59
|
+
end
|
60
|
+
|
48
61
|
alias_method :_pagination_original_pagination_enabled?, :pagination_enabled?
|
49
62
|
|
50
63
|
# Overwrites the original method to check +paginate_file+ and
|
51
64
|
# +paginate_files+ configuration options.
|
52
65
|
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
|
66
|
+
paginate_files(config).include?(file) if config['paginate']
|
57
67
|
end
|
58
68
|
|
59
69
|
end
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
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-
|
18
|
+
date: 2010-09-16 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -48,9 +48,9 @@ rdoc_options:
|
|
48
48
|
- README
|
49
49
|
- --line-numbers
|
50
50
|
- --inline-source
|
51
|
+
- --all
|
51
52
|
- --charset
|
52
53
|
- UTF-8
|
53
|
-
- --all
|
54
54
|
require_paths:
|
55
55
|
- lib
|
56
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|