dimples 6.2.1 → 6.2.2
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/bin/dimples +2 -1
- data/lib/dimples.rb +1 -0
- data/lib/dimples/pager.rb +1 -0
- data/lib/dimples/post.rb +1 -1
- data/lib/dimples/site.rb +44 -53
- 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: 21a60d2b84e1719f4e61d24bf855fbcf51ebb21a
|
4
|
+
data.tar.gz: fdc5daaa67484d85c6fa745f8a4df44184543fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485c8d88d322a27221e219de92ba0144d76bc7358c2f1026261efc22672451770d8fbb3b72143f15a20b795452714b12c2a3ed374fb2b7f0db23051ac4998bd3
|
7
|
+
data.tar.gz: 5333091633ef50a30261559a3ee0c53bfc199c37e7793f9d581c38c8145a85c78b6a9c1cf8d2b4b1a0309c2ecba5f5e4f5ce7c5f133dcd49722d687394281a15
|
data/bin/dimples
CHANGED
data/lib/dimples.rb
CHANGED
data/lib/dimples/pager.rb
CHANGED
data/lib/dimples/post.rb
CHANGED
data/lib/dimples/site.rb
CHANGED
@@ -125,13 +125,22 @@ module Dimples
|
|
125
125
|
|
126
126
|
def copy_static_assets
|
127
127
|
return unless Dir.exist?(@paths[:static])
|
128
|
+
|
128
129
|
FileUtils.cp_r(File.join(@paths[:static], '.'), @paths[:destination])
|
129
130
|
rescue StandardError => e
|
130
131
|
raise GenerationError, "Failed to copy site assets (#{e.message})"
|
131
132
|
end
|
132
133
|
|
133
134
|
def publish_posts
|
134
|
-
@posts.each
|
135
|
+
@posts.each do |post|
|
136
|
+
path = File.join(
|
137
|
+
@paths[:destination],
|
138
|
+
post.date.strftime(@config.paths.posts),
|
139
|
+
post.slug
|
140
|
+
)
|
141
|
+
|
142
|
+
post.write(path)
|
143
|
+
end
|
135
144
|
|
136
145
|
if @config.generation.main_feed
|
137
146
|
publish_feeds(@posts, @paths[:destination])
|
@@ -147,31 +156,19 @@ module Dimples
|
|
147
156
|
)
|
148
157
|
end
|
149
158
|
|
150
|
-
def publish_post(post)
|
151
|
-
path = File.join(
|
152
|
-
@paths[:destination],
|
153
|
-
post.date.strftime(@config.paths.posts),
|
154
|
-
post.slug
|
155
|
-
)
|
156
|
-
|
157
|
-
post.write(path)
|
158
|
-
end
|
159
|
-
|
160
159
|
def publish_pages
|
161
|
-
@pages.each
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
160
|
+
@pages.each do |page|
|
161
|
+
path = if page.path
|
162
|
+
File.dirname(page.path).sub(
|
163
|
+
@paths[:pages],
|
164
|
+
@paths[:destination]
|
165
|
+
)
|
166
|
+
else
|
168
167
|
@paths[:destination]
|
169
|
-
|
170
|
-
else
|
171
|
-
@paths[:destination]
|
172
|
-
end
|
168
|
+
end
|
173
169
|
|
174
|
-
|
170
|
+
page.write(path)
|
171
|
+
end
|
175
172
|
end
|
176
173
|
|
177
174
|
def publish_archives
|
@@ -217,41 +214,35 @@ module Dimples
|
|
217
214
|
end
|
218
215
|
|
219
216
|
def publish_categories
|
220
|
-
@categories.each_value
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
category.
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
context
|
239
|
-
|
240
|
-
|
241
|
-
publish_feeds(category_posts, path, context)
|
217
|
+
@categories.each_value do |category|
|
218
|
+
path = File.join(
|
219
|
+
@paths[:destination],
|
220
|
+
@config.paths.categories,
|
221
|
+
category.slug
|
222
|
+
)
|
223
|
+
|
224
|
+
category_posts = category.posts.reverse
|
225
|
+
context = { page: { title: category.name, category: category } }
|
226
|
+
|
227
|
+
Dimples::Pager.paginate(
|
228
|
+
self,
|
229
|
+
category_posts,
|
230
|
+
path,
|
231
|
+
@config.layouts.category,
|
232
|
+
context
|
233
|
+
)
|
234
|
+
|
235
|
+
publish_feeds(category_posts, path, context)
|
236
|
+
end
|
242
237
|
end
|
243
238
|
|
244
239
|
def publish_feeds(posts, path, context = {})
|
245
240
|
@config.feed_formats.each do |format|
|
246
|
-
|
247
|
-
end
|
248
|
-
end
|
241
|
+
feed = Feed.new(self, format)
|
249
242
|
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
feed.feed_posts = posts.slice(0, @config.pagination.per_page)
|
254
|
-
feed.write(path, context)
|
243
|
+
feed.feed_posts = posts.slice(0, @config.pagination.per_page)
|
244
|
+
feed.write(path, context)
|
245
|
+
end
|
255
246
|
end
|
256
247
|
end
|
257
248
|
end
|
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: 6.2.
|
4
|
+
version: 6.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|