jekyll-import 0.5.2 → 0.5.3

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: 5377b9f9f9a8fa28a027521a9b561644437fb66d
4
- data.tar.gz: 0428619e8d2b42b1f4f1952f2ec6dc0af826e323
3
+ metadata.gz: 855c5e36be4360af072339df9731c697be2d2fc7
4
+ data.tar.gz: f3cdbed992f885c71821ce3c2e97497ef6e7253b
5
5
  SHA512:
6
- metadata.gz: 8387badef6af7bf3242b2dd102e1a47af5fef6e9d80f03b6c4fa684338c330681e66287b358a860872d32d24a55cd3c3312c9c4fb56f4474b25b8e58db1ba155
7
- data.tar.gz: f7a4320db20712464ff92753d50d7b3057a04cdfbc9f6e56a2cefcb0e1c37958352546e0124097173294a6965ad7b4402b39d9d7f28927f01b3ac4f10e23e212
6
+ metadata.gz: 284cb23924967d43155a095931c95cee8548e29a12cca3c1feef5d77debdae194dacfcb6a9de939ac933869592053d242086ffb6d392ea1701a73027fff98758
7
+ data.tar.gz: 8c1e96ca71c5b83ac2df39d424351d287c910cc431ca85f2ed5c7b0d9d27bc34ca291413a785e9ef778a6ecd156c4f86f92def3d8370782500c172dde7e6c6a2
@@ -204,15 +204,26 @@ module JekyllImport
204
204
  if (@in_entry_elem.nil? || ! @in_entry_elem.has_key?(:meta) || ! @in_entry_elem[:meta].has_key?(:kind))
205
205
  nil
206
206
  elsif @in_entry_elem[:meta][:kind] == 'post'
207
+ timestamp = Time.parse(@in_entry_elem[:meta][:published]).strftime('%Y-%m-%d')
207
208
  if @in_entry_elem[:meta][:original_url]
208
209
  original_uri = URI.parse(@in_entry_elem[:meta][:original_url])
209
210
  original_path = original_uri.path.to_s
210
211
  filename = "%s-%s" %
211
- [Time.parse(@in_entry_elem[:meta][:published]).strftime('%Y-%m-%d'),
212
+ [timestamp,
212
213
  File.basename(original_path, File.extname(original_path))]
213
214
 
214
215
  @original_url_base = "#{original_uri.scheme}://#{original_uri.host}"
215
- else
216
+ elsif @in_entry_elem[:meta][:draft]
217
+ # Drafts don't have published urls
218
+ name = @in_entry_elem[:meta][:title]
219
+ if name.nil?
220
+ filename = timestamp
221
+ else
222
+ filename = "%s-%s" %
223
+ [timestamp,
224
+ CGI.escape(name.downcase).tr('+','-')]
225
+ end
226
+ else
216
227
  raise 'Original URL is missing'
217
228
  end
218
229
 
@@ -226,7 +237,7 @@ module JekyllImport
226
237
  header['modified_time'] = @in_entry_elem[:meta][:updated] if @in_entry_elem[:meta][:updated] && @in_entry_elem[:meta][:updated] != @in_entry_elem[:meta][:published]
227
238
  header['thumbnail'] = @in_entry_elem[:meta][:thumbnail] if @in_entry_elem[:meta][:thumbnail]
228
239
  header['blogger_id'] = @in_entry_elem[:meta][:id] if @leave_blogger_info
229
- header['blogger_orig_url'] = @in_entry_elem[:meta][:original_url] if @leave_blogger_info
240
+ header['blogger_orig_url'] = @in_entry_elem[:meta][:original_url] if @leave_blogger_info && @in_entry_elem[:meta][:original_url]
230
241
 
231
242
  body = @in_entry_elem[:body]
232
243
 
@@ -1,3 +1,3 @@
1
1
  module JekyllImport
2
- VERSION = '0.5.2'
2
+ VERSION = '0.5.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2014-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll