dimples 4.1.3 → 4.2.0
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 +22 -20
- 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: fc01bb40770e8a3a3b7884110770715e3208b896
|
4
|
+
data.tar.gz: 61311224553e98e92284f604fe3365bebe91ceff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81a7521d8dc5b54bb4dba111bbba718a3a2fb1ab4e076481a3179849b5762c6a62adec5de18e51bafccd6d1b0febd4e088dcaaeb4e2aff90d74e4d2cacf6ed10
|
7
|
+
data.tar.gz: 23c81dd7c232953de8ab1b190dd1fb0ff4d251fc9da6d325b8077245a89ba32b3d9d3313a9e0db7b90b57edae4d76ce9ffca88372982c2fd2d159a15df08a852
|
data/lib/dimples/site.rb
CHANGED
@@ -45,15 +45,7 @@ module Dimples
|
|
45
45
|
def generate
|
46
46
|
scan_files
|
47
47
|
prepare_output_directory
|
48
|
-
|
49
|
-
generate_pages unless @pages.count.zero?
|
50
|
-
|
51
|
-
unless @posts.count.zero?
|
52
|
-
generate_posts
|
53
|
-
generate_archives
|
54
|
-
generate_categories if @config[:generation][:categories]
|
55
|
-
end
|
56
|
-
|
48
|
+
publish_files
|
57
49
|
copy_assets
|
58
50
|
rescue Errors::RenderingError,
|
59
51
|
Errors::PublishingError,
|
@@ -61,6 +53,16 @@ module Dimples
|
|
61
53
|
@errors << e.message
|
62
54
|
end
|
63
55
|
|
56
|
+
def publish_files
|
57
|
+
publish_pages unless @pages.count.zero?
|
58
|
+
|
59
|
+
unless @posts.count.zero?
|
60
|
+
publish_posts
|
61
|
+
publish_archives
|
62
|
+
publish_categories if @config[:generation][:categories]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
64
66
|
def generated?
|
65
67
|
@errors.count.zero?
|
66
68
|
end
|
@@ -143,7 +145,7 @@ module Dimples
|
|
143
145
|
raise Errors::GenerationError, error_message
|
144
146
|
end
|
145
147
|
|
146
|
-
def
|
148
|
+
def publish_posts
|
147
149
|
if @config[:verbose_logging]
|
148
150
|
Dimples.logger.debug_generation('posts', @posts.length)
|
149
151
|
end
|
@@ -157,10 +159,10 @@ module Dimples
|
|
157
159
|
@config[:layouts][:posts]
|
158
160
|
)
|
159
161
|
|
160
|
-
|
162
|
+
publish_posts_feeds if @config[:generation][:feeds]
|
161
163
|
end
|
162
164
|
|
163
|
-
def
|
165
|
+
def publish_pages
|
164
166
|
if @config[:verbose_logging]
|
165
167
|
Dimples.logger.debug_generation('pages', @pages.length)
|
166
168
|
end
|
@@ -168,7 +170,7 @@ module Dimples
|
|
168
170
|
@pages.each(&:write)
|
169
171
|
end
|
170
172
|
|
171
|
-
def
|
173
|
+
def publish_categories
|
172
174
|
if @config[:verbose_logging]
|
173
175
|
Dimples.logger.debug_generation('category pages', @categories.length)
|
174
176
|
end
|
@@ -190,10 +192,10 @@ module Dimples
|
|
190
192
|
)
|
191
193
|
end
|
192
194
|
|
193
|
-
|
195
|
+
publish_category_feeds if @config[:generation][:category_feeds]
|
194
196
|
end
|
195
197
|
|
196
|
-
def
|
198
|
+
def publish_archives
|
197
199
|
%w[year month day].each do |date_type|
|
198
200
|
date_archives_sym = "#{date_type}_archives".to_sym
|
199
201
|
next unless @config[:generation][date_archives_sym]
|
@@ -220,7 +222,7 @@ module Dimples
|
|
220
222
|
end
|
221
223
|
end
|
222
224
|
|
223
|
-
def
|
225
|
+
def publish_feeds(path, context)
|
224
226
|
feed_templates.each do |format|
|
225
227
|
next unless @templates[format]
|
226
228
|
|
@@ -235,17 +237,17 @@ module Dimples
|
|
235
237
|
end
|
236
238
|
end
|
237
239
|
|
238
|
-
def
|
240
|
+
def publish_posts_feeds
|
239
241
|
posts = @posts[0..@config[:pagination][:per_page] - 1]
|
240
|
-
|
242
|
+
publish_feeds(@output_paths[:site], posts: posts)
|
241
243
|
end
|
242
244
|
|
243
|
-
def
|
245
|
+
def publish_category_feeds
|
244
246
|
@categories.each_value do |category|
|
245
247
|
path = File.join(@output_paths[:categories], category.slug)
|
246
248
|
posts = category.posts[0..@config[:pagination][:per_page] - 1]
|
247
249
|
|
248
|
-
|
250
|
+
publish_feeds(path, posts: posts, category: category.slug)
|
249
251
|
end
|
250
252
|
end
|
251
253
|
|
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: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|