dimples 6.5.2 → 6.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a6f8617d58941c5af9745c1bd0ceaf12ecaaafc7bd4e79e2b1b2f40f5b0bd0c
4
- data.tar.gz: db3408502d32f1404de50d050a2cec1d055b505ad2f4195fb00ef60500cd4f75
3
+ metadata.gz: 29f825d2b0c07f416c9d14934cd4de922a57d7f8ffc63a6212b4a7a37f3a17be
4
+ data.tar.gz: 9b90c34993bd637ab9c74e446b4c755bba9ab74ca93d7213a6c7f41c49a02964
5
5
  SHA512:
6
- metadata.gz: 3a48b54049b77629a6996ac98d850a02d6a780e13ef2b6a93a380f712dbb423153a0cad78b05a9c4abc3da2fa2ad6dae1f384dd40b36670c97d9e0eace8a16cb
7
- data.tar.gz: 1f197dc175792163a2bda5ecfcf4b359fbf28412dacfe53fa1f3c0f73174867744fc9b65137656a0ba62e19769b63e055cc8aed8bf6baf2707485f08346390cb
6
+ metadata.gz: 1d11b6b61a326e236cbcf61f70601c16bdff017b7c8751696c7e5c7dfc986be513bab79af18e29e9b8628ccc77f49e946778980d97f56a83eefd98398b8db03a
7
+ data.tar.gz: e54743e65c9b6523bfd62d60d832222525486aba0daa92704ed0601bee1c09fa2a72a143aec44e8f7a7e6a1089eb016825ba486d8d9132dbb9696e2ea0977701
@@ -27,6 +27,7 @@ module Dimples
27
27
  archives: 'archives',
28
28
  paginated_posts: 'posts',
29
29
  posts: 'archives/%Y/%m/%d',
30
+ drafts: 'archives/drafts/%Y/%m/%d',
30
31
  categories: 'archives/categories'
31
32
  }
32
33
  end
@@ -15,6 +15,7 @@ module Dimples
15
15
  @metadata[:date] = Date.new(parts[1].to_i, parts[2].to_i, parts[3].to_i)
16
16
  @metadata[:slug] = parts[4]
17
17
  @metadata[:categories] ||= []
18
+ @metadata[:draft] ||= false
18
19
  end
19
20
 
20
21
  def year
@@ -135,22 +135,24 @@ module Dimples
135
135
  @posts.each do |post|
136
136
  path = File.join(
137
137
  @paths[:destination],
138
- post.date.strftime(@config.paths.posts),
138
+ post.date.strftime(post.draft ? @config.paths.drafts : @config.paths.posts),
139
139
  post.slug
140
140
  )
141
141
 
142
142
  post.write(path)
143
143
  end
144
144
 
145
+ published_posts = @posts.select { |post| !post.draft }
146
+
145
147
  if @config.generation.main_feed
146
- publish_feeds(@posts, @paths[:destination])
148
+ publish_feeds(published_posts, @paths[:destination])
147
149
  end
148
150
 
149
151
  return unless @config.generation.paginated_posts
150
152
 
151
153
  Dimples::Pager.paginate(
152
154
  self,
153
- @posts,
155
+ published_posts,
154
156
  File.join(@paths[:destination], @config.paths.paginated_posts),
155
157
  @config.layouts.paginated_post
156
158
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dimples
4
- VERSION = '6.5.2'
4
+ VERSION = '6.5.3'
5
5
  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: 6.5.2
4
+ version: 6.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-11 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie