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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cee8ecb479f503e8ece058309263c9e2938cd43
4
- data.tar.gz: 91394c39524a45ba5799c84ba19a206cb9cb43f0
3
+ metadata.gz: 0e7068aa3c739c2b72509aa0460ca6d39dc32143
4
+ data.tar.gz: 76991ddb0a792f06202a86111753eb6c0b27d499
5
5
  SHA512:
6
- metadata.gz: 2571e6458603880d8d1dd9f05f86ccfe6ce8197a1a15402dd6b2312581b3543d3e3a2c377fd43687597b6ee6555e9bf7aeb0997a347924341b33a9ca601aecc5
7
- data.tar.gz: 10a1c214aab4f4bef3c1f2c29afee61897d27aca18c1abc44f16a2f9778d2f10b9c89ed22dcc9d9c63a5c1164102ff208174b666e9d48b1704c2fdbdfaa56af2
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: pagination_url(index, paths)
214
+ path: pagination_path
221
215
  }
222
216
 
223
217
  pagination[:previous_page] = pagination[:page] - 1 if (pagination[:page] - 1) > 0
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan