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 +4 -4
- data/lib/jekyll-import/importers/blogger.rb +14 -3
- data/lib/jekyll-import/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: 855c5e36be4360af072339df9731c697be2d2fc7
|
4
|
+
data.tar.gz: f3cdbed992f885c71821ce3c2e97497ef6e7253b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
[
|
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
|
-
|
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
|
|
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.
|
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-
|
11
|
+
date: 2014-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|