dimples 1.6.0 → 1.6.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: 3fa5d0419f051981d0c5882d05e73e6a00ce8645
4
- data.tar.gz: 78cba06d835383fb0c228fa2f86d09fb4ef86e42
3
+ metadata.gz: 72a1ccc11c1b35f8b03553168257b12b3636b537
4
+ data.tar.gz: e4ca763ddb24c1db9534bd2559994252ac614f8e
5
5
  SHA512:
6
- metadata.gz: f8374cb12ecdaef8b29e275ff9bf0b360cdd1d4bf499461b75ea557b7af654a0483f480473d7af9196c9071a318f5560311dd2d9d85c69179ae5b4667e58aeb3
7
- data.tar.gz: 7b6d95f406e6d2d13e1e416e4e9ae4bb5d94df0cfce1b8974e22fc9176acd8860623752e7d76d0915cb1ca03a5962a1fafde944f307ef4a9587f33fe67b9cb1a
6
+ metadata.gz: 1b945d743976ee0b4e45a39786ea4bfc176db03beebf460f96b49ebb7eb6b44cc339e20811e9d4185025fea96a8a7f0a79dfd6d86fab7dcf54aa91b090efdf44
7
+ data.tar.gz: 457c0b77ed9c0acef42c70042247b9b220db9541a3e7523cbad6dc413e071469030425651e6a19bfba7a32f2f632a0578762dce4e683bb548a178aed88dfd26b
@@ -143,7 +143,7 @@ module Dimples
143
143
  def generate_categories
144
144
  @categories.each do |slug, posts|
145
145
  category_name = @config['category_names'][slug] || slug.capitalize
146
- paginate(posts: posts, title: category_name, paths: [@output_paths[:categories], slug], layout: @config['layouts']['category'])
146
+ paginate(posts: posts, title: category_name, paths: [@output_paths[:categories], slug], layout: @config['layouts']['category'], context: {category: slug})
147
147
  end
148
148
  end
149
149
 
@@ -193,7 +193,7 @@ module Dimples
193
193
  end
194
194
  end
195
195
 
196
- def paginate(posts:, title: nil, paths:, layout: false)
196
+ def paginate(posts:, title: nil, paths:, layout: false, context: {})
197
197
  fail "'#{layout}' template not found" unless @templates.has_key?(layout)
198
198
 
199
199
  per_page = @config['pagination']['per_page']
@@ -226,8 +226,9 @@ module Dimples
226
226
  pagination[:next_page_url] = pagination[:path] + "page" + pagination[:next_page].to_s if pagination[:next_page]
227
227
 
228
228
  output_path = File.join(paths, index != 1 ? "page#{index}" : '')
229
+ context.merge!({posts: posts.slice((index - 1) * per_page, per_page), pagination: pagination})
229
230
 
230
- page.write(output_path, {posts: posts.slice((index - 1) * per_page, per_page), pagination: pagination})
231
+ page.write(output_path, context)
231
232
  end
232
233
  end
233
234
 
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dimples
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt