jekyll-paginate_command 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +247 -0
- data/Rakefile +10 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/jekyll-paginate_command.gemspec +27 -0
- data/lib/jekyll-paginate_command.rb +13 -0
- data/lib/jekyll-paginate_command/pagination.rb +120 -0
- data/lib/jekyll-paginate_command/version.rb +5 -0
- data/lib/jekyll/commands/paginate.rb +54 -0
- metadata +126 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c0279e4179a95bae6fa7ee29e0b75544202fa523
|
4
|
+
data.tar.gz: 05d48f8e7492a533a117a4ce193f18097efce2ff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 151892c55657ef18148511352d1b5c04edc5e24fea17449a01992bd6c22b7a307e94ac34fb12a185aba482dcb47d98c99807542ea4953c035376f6aede805450
|
7
|
+
data.tar.gz: b362727f29f12b7c23908683bb34953b9211df3f3ee84797cb47a09f0f7e1aef719c3edce82505dfaab3208e7a3ddec7bae29b5110cd526974e2f3fd6af466c4
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Takuya Tsuchida
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,247 @@
|
|
1
|
+
# Jekyll::PaginateCommand
|
2
|
+
|
3
|
+
The paginate command for Jekyll generates pagination templates. Generated templates work well on GitHub Pages.
|
4
|
+
|
5
|
+
[](https://travis-ci.org/omoshetech/jekyll-paginate_command)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
group :jekyll_plugins do
|
13
|
+
gem 'jekyll-paginate_command'
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Install `jekyll-paginate_command` and run `jekyll help`.
|
24
|
+
|
25
|
+
You will see a new command:
|
26
|
+
|
27
|
+
```
|
28
|
+
paginate Generate pagination templates
|
29
|
+
```
|
30
|
+
|
31
|
+
To enable the pagination of your posts, add a line to the front matter in the `index.html` file:
|
32
|
+
|
33
|
+
```yaml
|
34
|
+
paginate: true
|
35
|
+
```
|
36
|
+
|
37
|
+
And then execute:
|
38
|
+
|
39
|
+
$ jekyll paginate
|
40
|
+
|
41
|
+
This command generates a `paginator` variable like the `jekyll-paginate` plugin.
|
42
|
+
The difference of this command is a `paginator` variable is directly written in the front matter.
|
43
|
+
Therefore, you need to access the `paginator` variable as `page.paginator`.
|
44
|
+
You can see the generated front matter in the `index.html` file:
|
45
|
+
|
46
|
+
```yaml
|
47
|
+
---
|
48
|
+
layout: default
|
49
|
+
paginate: true
|
50
|
+
paginator:
|
51
|
+
per_page: 10
|
52
|
+
total_posts: 26
|
53
|
+
total_pages: 3
|
54
|
+
page: 1
|
55
|
+
next_page: 2
|
56
|
+
next_page_path: "/page2/"
|
57
|
+
---
|
58
|
+
```
|
59
|
+
|
60
|
+
This command also generates pagination templates in the `paginations` directory.
|
61
|
+
These pages have same content of first page except front matter variables.
|
62
|
+
|
63
|
+
When you write a new post, you need to run `jekyll paginate` before previewing your site.
|
64
|
+
|
65
|
+
## Examples
|
66
|
+
|
67
|
+
Here is examples of a paginated page.
|
68
|
+
|
69
|
+
### Posts
|
70
|
+
|
71
|
+
/index.html
|
72
|
+
|
73
|
+
```html
|
74
|
+
---
|
75
|
+
layout: default
|
76
|
+
paginate: true
|
77
|
+
paginator:
|
78
|
+
per_page: 10
|
79
|
+
total_posts: 26
|
80
|
+
total_pages: 3
|
81
|
+
page: 1
|
82
|
+
next_page: 2
|
83
|
+
next_page_path: "/page2/"
|
84
|
+
---
|
85
|
+
{% assign paginator = page.paginator %}
|
86
|
+
|
87
|
+
<div class="home">
|
88
|
+
|
89
|
+
<h1 class="page-heading">Posts</h1>
|
90
|
+
|
91
|
+
<ul class="post-list">
|
92
|
+
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
|
93
|
+
{% for post in site.posts limit: paginator.per_page offset: offset %}
|
94
|
+
<li>
|
95
|
+
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
|
96
|
+
|
97
|
+
<h2>
|
98
|
+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
|
99
|
+
</h2>
|
100
|
+
</li>
|
101
|
+
{% endfor %}
|
102
|
+
</ul>
|
103
|
+
|
104
|
+
{% if paginator.total_pages > 1 %}
|
105
|
+
<div class="pagination">
|
106
|
+
{% if paginator.previous_page %}
|
107
|
+
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a>
|
108
|
+
{% else %}
|
109
|
+
<span>« Prev</span>
|
110
|
+
{% endif %}
|
111
|
+
|
112
|
+
{% assign paginate_relative_path = site.paginate_relative_path | default: '/page:num/' %}
|
113
|
+
{% assign relative_path = paginate_relative_path | replace: ':num', paginator.page %}
|
114
|
+
{% assign url = page.url | replace: relative_path, '/' %}
|
115
|
+
|
116
|
+
{% for page in (1..paginator.total_pages) %}
|
117
|
+
{% if page == paginator.page %}
|
118
|
+
<em>{{ page }}</em>
|
119
|
+
{% elsif page == 1 %}
|
120
|
+
<a href="{{ url | append: '/' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
|
121
|
+
{% else %}
|
122
|
+
<a href="{{ url | append: paginate_relative_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
|
123
|
+
{% endif %}
|
124
|
+
{% endfor %}
|
125
|
+
|
126
|
+
{% if paginator.next_page %}
|
127
|
+
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a>
|
128
|
+
{% else %}
|
129
|
+
<span>Next »</span>
|
130
|
+
{% endif %}
|
131
|
+
</div>
|
132
|
+
{% endif %}
|
133
|
+
|
134
|
+
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
|
135
|
+
|
136
|
+
</div>
|
137
|
+
```
|
138
|
+
|
139
|
+
### Category
|
140
|
+
|
141
|
+
/categories/jekyll/index.html
|
142
|
+
|
143
|
+
```html
|
144
|
+
---
|
145
|
+
layout: default
|
146
|
+
category: jekyll
|
147
|
+
paginate: true
|
148
|
+
paginator:
|
149
|
+
per_page: 10
|
150
|
+
total_posts: 26
|
151
|
+
total_pages: 3
|
152
|
+
page: 1
|
153
|
+
next_page: 2
|
154
|
+
next_page_path: "/categories/jekyll/page2/"
|
155
|
+
---
|
156
|
+
{% assign paginator = page.paginator %}
|
157
|
+
|
158
|
+
<div class="home">
|
159
|
+
|
160
|
+
<h1 class="page-heading">Posts</h1>
|
161
|
+
|
162
|
+
<ul class="post-list">
|
163
|
+
{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
|
164
|
+
{% for post in site.categories[page.category] limit: paginator.per_page offset: offset %}
|
165
|
+
<li>
|
166
|
+
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
|
167
|
+
|
168
|
+
<h2>
|
169
|
+
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
|
170
|
+
</h2>
|
171
|
+
</li>
|
172
|
+
{% endfor %}
|
173
|
+
</ul>
|
174
|
+
|
175
|
+
{% if paginator.total_pages > 1 %}
|
176
|
+
<div class="pagination">
|
177
|
+
{% if paginator.previous_page %}
|
178
|
+
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">« Prev</a>
|
179
|
+
{% else %}
|
180
|
+
<span>« Prev</span>
|
181
|
+
{% endif %}
|
182
|
+
|
183
|
+
{% assign paginate_relative_path = site.paginate_relative_path | default: '/page:num/' %}
|
184
|
+
{% assign relative_path = paginate_relative_path | replace: ':num', paginator.page %}
|
185
|
+
{% assign url = page.url | replace: relative_path, '/' %}
|
186
|
+
|
187
|
+
{% for page in (1..paginator.total_pages) %}
|
188
|
+
{% if page == paginator.page %}
|
189
|
+
<em>{{ page }}</em>
|
190
|
+
{% elsif page == 1 %}
|
191
|
+
<a href="{{ url | append: '/' | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
|
192
|
+
{% else %}
|
193
|
+
<a href="{{ url | append: paginate_relative_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
|
194
|
+
{% endif %}
|
195
|
+
{% endfor %}
|
196
|
+
|
197
|
+
{% if paginator.next_page %}
|
198
|
+
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next »</a>
|
199
|
+
{% else %}
|
200
|
+
<span>Next »</span>
|
201
|
+
{% endif %}
|
202
|
+
</div>
|
203
|
+
{% endif %}
|
204
|
+
|
205
|
+
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
```
|
209
|
+
|
210
|
+
## Configurations
|
211
|
+
|
212
|
+
### Global Configurations
|
213
|
+
|
214
|
+
|Configuration |Type |Default |Description |
|
215
|
+
|----------------------|-------|-----------|-----------------------------------------------------------------------|
|
216
|
+
|paginate_per_page |Integer|10 |Set the number of posts per page. |
|
217
|
+
|paginate_relative_path|String |/page:num/ |Set the relative path of paginated pages from the first page directory.|
|
218
|
+
|paginate_destination |String |paginations|Set the destination of pagination templates. |
|
219
|
+
|
220
|
+
### Front Matter Variables
|
221
|
+
|
222
|
+
|Variable|Type |Description |
|
223
|
+
|--------|-------|-----------------------------------|
|
224
|
+
|paginate|Boolean|Enable the pagination. |
|
225
|
+
|category|String |Set a category for filtering posts.|
|
226
|
+
|tag |String |Set a tag for filtering posts. |
|
227
|
+
|
228
|
+
### Generated Variables for Liquid
|
229
|
+
|
230
|
+
|Variable |Description |
|
231
|
+
|---------------------------------|--------------------------------------------------------------------|
|
232
|
+
|page.paginator.per_page |The number of Posts per page. |
|
233
|
+
|page.paginator.total_posts |The total number of Posts. |
|
234
|
+
|page.paginator.total_pages |The total number of Pages. |
|
235
|
+
|page.paginator.page |The number of the current page. |
|
236
|
+
|page.paginator.previous_page |The number of the previous page, or `nil` if no previous page exist.|
|
237
|
+
|page.paginator.previous_page_path|The path to the previous page, or `nil` if no previous page exist. |
|
238
|
+
|page.paginator.next_page |The number of the next page, or `nil` if no next page exist. |
|
239
|
+
|page.paginator.next_page_path |The path to the next page, or `nil` if no next page exist. |
|
240
|
+
|
241
|
+
## Contributing
|
242
|
+
|
243
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/omoshetech/jekyll-paginate_command.
|
244
|
+
|
245
|
+
## License
|
246
|
+
|
247
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jekyll"
|
5
|
+
require "jekyll-paginate_command"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jekyll-paginate_command/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jekyll-paginate_command"
|
8
|
+
spec.version = Jekyll::PaginateCommand::VERSION
|
9
|
+
spec.authors = ["Takuya Tsuchida"]
|
10
|
+
spec.email = ["omoshetech.t+git@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{The paginate command for Jekyll generates pagination templates}
|
13
|
+
spec.description = %q{The paginate command for Jekyll generates pagination templates}
|
14
|
+
spec.homepage = "https://github.com/omoshetech/jekyll-paginate_command"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "jekyll", ">= 2.5.0"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
26
|
+
spec.add_development_dependency "minitest-reporters", ">= 0.5.0"
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "jekyll-paginate_command/version"
|
2
|
+
require "jekyll-paginate_command/pagination"
|
3
|
+
require "jekyll/commands/paginate"
|
4
|
+
|
5
|
+
module Jekyll
|
6
|
+
module PaginateCommand
|
7
|
+
DEFAULTS = {
|
8
|
+
'paginate_per_page' => 10,
|
9
|
+
'paginate_relative_path' => '/page:num/',
|
10
|
+
'paginate_destination' => File.join(Dir.pwd, 'paginations')
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module PaginateCommand
|
3
|
+
class Pagination
|
4
|
+
def initialize(base, site)
|
5
|
+
@base = base
|
6
|
+
@site = site
|
7
|
+
@config = site.config
|
8
|
+
end
|
9
|
+
|
10
|
+
def generate
|
11
|
+
(1..total_pages).each do |page|
|
12
|
+
@page = page
|
13
|
+
generate_current_page
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def generate_current_page
|
20
|
+
Jekyll.logger.debug "Writing:", file_path
|
21
|
+
FileUtils.mkpath(dir_path)
|
22
|
+
File.write(file_path, file_content)
|
23
|
+
end
|
24
|
+
|
25
|
+
def dir_path
|
26
|
+
File.dirname(file_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
def file_path
|
30
|
+
if 1 < page
|
31
|
+
File.join(@config['paginate_destination'], @base.dir, "#{page}.html")
|
32
|
+
else
|
33
|
+
File.join(@config['source'], @base.path)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def file_content
|
38
|
+
front_matter.concat(@base.content)
|
39
|
+
end
|
40
|
+
|
41
|
+
def front_matter
|
42
|
+
@base.data.merge(data).to_yaml.concat("---\n")
|
43
|
+
end
|
44
|
+
|
45
|
+
def data
|
46
|
+
{
|
47
|
+
'paginate' => paginate,
|
48
|
+
'paginator' => paginator,
|
49
|
+
'permalink' => permalink
|
50
|
+
}.select { |_, value| !value.nil? }
|
51
|
+
end
|
52
|
+
|
53
|
+
def paginate
|
54
|
+
1 < page ? false : true
|
55
|
+
end
|
56
|
+
|
57
|
+
def paginator
|
58
|
+
{
|
59
|
+
'per_page' => per_page,
|
60
|
+
'total_posts' => total_posts,
|
61
|
+
'total_pages' => total_pages,
|
62
|
+
'page' => page,
|
63
|
+
'previous_page' => previous_page,
|
64
|
+
'previous_page_path' => previous_page_path,
|
65
|
+
'next_page' => next_page,
|
66
|
+
'next_page_path' => next_page_path
|
67
|
+
}.select { |_, value| !value.nil? }
|
68
|
+
end
|
69
|
+
|
70
|
+
def per_page
|
71
|
+
@per_page ||= @config['paginate_per_page']
|
72
|
+
end
|
73
|
+
|
74
|
+
def total_posts
|
75
|
+
@total_posts ||= count_posts
|
76
|
+
end
|
77
|
+
|
78
|
+
def count_posts
|
79
|
+
case
|
80
|
+
when @base['category'] then @site.categories[@base['category']].length
|
81
|
+
when @base['tag'] then @site.tags[@base['tag']].length
|
82
|
+
else @site.posts.docs.length
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def total_pages
|
87
|
+
@total_pages ||= total_posts.fdiv(per_page).ceil
|
88
|
+
end
|
89
|
+
|
90
|
+
def page
|
91
|
+
@page
|
92
|
+
end
|
93
|
+
|
94
|
+
def previous_page
|
95
|
+
1 < page ? page - 1 : nil
|
96
|
+
end
|
97
|
+
|
98
|
+
def previous_page_path
|
99
|
+
return @base.url if previous_page == 1
|
100
|
+
previous_page ? paginate_path.sub(':num', previous_page.to_s) : nil
|
101
|
+
end
|
102
|
+
|
103
|
+
def next_page
|
104
|
+
page < total_pages ? page + 1 : nil
|
105
|
+
end
|
106
|
+
|
107
|
+
def next_page_path
|
108
|
+
next_page ? paginate_path.sub(':num', next_page.to_s) : nil
|
109
|
+
end
|
110
|
+
|
111
|
+
def paginate_path
|
112
|
+
@paginate_path ||= File.join(@base.dir, @config['paginate_relative_path'])
|
113
|
+
end
|
114
|
+
|
115
|
+
def permalink
|
116
|
+
1 < page ? paginate_path.sub(':num', page.to_s) : nil
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module Commands
|
3
|
+
class Paginate < Command
|
4
|
+
class << self
|
5
|
+
def init_with_program(prog)
|
6
|
+
prog.command(:paginate) do |c|
|
7
|
+
c.version Jekyll::PaginateCommand::VERSION
|
8
|
+
c.syntax 'paginate [options]'
|
9
|
+
c.description 'Generate pagination templates'
|
10
|
+
|
11
|
+
c.option 'quiet', '-q', '--quiet', 'Silence output.'
|
12
|
+
c.option 'verbose', '-V', '--verbose', 'Print verbose output.'
|
13
|
+
|
14
|
+
c.action do |_, options|
|
15
|
+
process(options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def process(options)
|
21
|
+
config = config(options)
|
22
|
+
site = site(config)
|
23
|
+
pages = target_pages(site)
|
24
|
+
paginate(pages, site)
|
25
|
+
end
|
26
|
+
|
27
|
+
def config(options)
|
28
|
+
defaults = Configuration[PaginateCommand::DEFAULTS]
|
29
|
+
config = configuration_from_options(options)
|
30
|
+
Utils.deep_merge_hashes(defaults, config)
|
31
|
+
end
|
32
|
+
|
33
|
+
def site(config)
|
34
|
+
site = Site.new(config)
|
35
|
+
site.read
|
36
|
+
site
|
37
|
+
end
|
38
|
+
|
39
|
+
def target_pages(site)
|
40
|
+
site.pages.select { |page| page['paginate'] }
|
41
|
+
end
|
42
|
+
|
43
|
+
def paginate(pages, site)
|
44
|
+
t = Time.now
|
45
|
+
Jekyll.logger.info "Source:", site.config['source']
|
46
|
+
Jekyll.logger.info "Destination:", site.config['paginate_destination']
|
47
|
+
Jekyll.logger.info "Paginating..."
|
48
|
+
pages.each { |page| PaginateCommand::Pagination.new(page, site).generate }
|
49
|
+
Jekyll.logger.info "", "done in #{(Time.now - t).round(3)} seconds."
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-paginate_command
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Takuya Tsuchida
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.5.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.11'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.11'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest-reporters
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.5.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.5.0
|
83
|
+
description: The paginate command for Jekyll generates pagination templates
|
84
|
+
email:
|
85
|
+
- omoshetech.t+git@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
92
|
+
- Gemfile
|
93
|
+
- LICENSE.txt
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- bin/console
|
97
|
+
- bin/setup
|
98
|
+
- jekyll-paginate_command.gemspec
|
99
|
+
- lib/jekyll-paginate_command.rb
|
100
|
+
- lib/jekyll-paginate_command/pagination.rb
|
101
|
+
- lib/jekyll-paginate_command/version.rb
|
102
|
+
- lib/jekyll/commands/paginate.rb
|
103
|
+
homepage: https://github.com/omoshetech/jekyll-paginate_command
|
104
|
+
licenses: []
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 2.5.1
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: The paginate command for Jekyll generates pagination templates
|
126
|
+
test_files: []
|