dimples 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/site.rb +4 -10
- data/lib/dimples/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7068aa3c739c2b72509aa0460ca6d39dc32143
|
4
|
+
data.tar.gz: 76991ddb0a792f06202a86111753eb6c0b27d499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611d5bf34fe6b6d7ee8e62b1807481484192969fdf5491d585056bbc3f6f2540d7b32665961c6f5132894d1850eb27f45ed862f0f1f08abac6b57da1e7ae59c6
|
7
|
+
data.tar.gz: ed1644bd76dc2b475e36c1bdc06f703f97ae67c40ae7d7bd7a3cb2bff65767c21d387c0c8ccad6824fa22d9d918517e4b5015a615752694c0504cfb33910d048
|
data/lib/dimples/site.rb
CHANGED
@@ -192,21 +192,15 @@ module Dimples
|
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
def pagination_url(page, paths)
|
196
|
-
path = '/'
|
197
|
-
|
198
|
-
path += File.split(paths[0])[-1] + "/" if paths[0] != @output_paths[:site]
|
199
|
-
path += paths[1..-1].join('/') + "/" if paths.length > 1
|
200
|
-
|
201
|
-
path
|
202
|
-
end
|
203
|
-
|
204
195
|
def paginate(posts:, title: nil, paths:, layout: false)
|
205
196
|
fail "'#{layout}' template not found" unless @templates.has_key?(layout)
|
206
197
|
|
207
198
|
per_page = @config['pagination']['per_page']
|
208
199
|
page_count = (posts.length.to_f / per_page.to_i).ceil
|
209
200
|
|
201
|
+
pagination_path = paths[0].gsub(@output_paths[:site], '') + '/'
|
202
|
+
pagination_path += paths[1..-1].join('/') + "/" if paths.length > 1
|
203
|
+
|
210
204
|
for index in 1..page_count
|
211
205
|
page = @page_class.new(self)
|
212
206
|
|
@@ -217,7 +211,7 @@ module Dimples
|
|
217
211
|
page: index,
|
218
212
|
pages: page_count,
|
219
213
|
post_count: posts.length,
|
220
|
-
path:
|
214
|
+
path: pagination_path
|
221
215
|
}
|
222
216
|
|
223
217
|
pagination[:previous_page] = pagination[:page] - 1 if (pagination[:page] - 1) > 0
|
data/lib/dimples/version.rb
CHANGED