dimples 1.6.0 → 1.6.1
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 +4 -4
- data/lib/dimples/site.rb +4 -3
- data/lib/dimples/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72a1ccc11c1b35f8b03553168257b12b3636b537
|
|
4
|
+
data.tar.gz: e4ca763ddb24c1db9534bd2559994252ac614f8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b945d743976ee0b4e45a39786ea4bfc176db03beebf460f96b49ebb7eb6b44cc339e20811e9d4185025fea96a8a7f0a79dfd6d86fab7dcf54aa91b090efdf44
|
|
7
|
+
data.tar.gz: 457c0b77ed9c0acef42c70042247b9b220db9541a3e7523cbad6dc413e071469030425651e6a19bfba7a32f2f632a0578762dce4e683bb548a178aed88dfd26b
|
data/lib/dimples/site.rb
CHANGED
|
@@ -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,
|
|
231
|
+
page.write(output_path, context)
|
|
231
232
|
end
|
|
232
233
|
end
|
|
233
234
|
|
data/lib/dimples/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2015-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tilt
|