jekyll-import 0.6.0 → 0.7.0
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/drupal7.rb +1 -1
- data/lib/jekyll-import/importers/tumblr.rb +12 -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: 201c546213ef922eaefabb7fd0d2a3120c39ff58
|
4
|
+
data.tar.gz: 9fbe1cf648f0ba24829b5288e4ae61e738864e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abaa5f3f91064400b2d2de1ee13be2b21ac6e6eb9b5c948aa8aff8ce3eccd85449a8e19b2c06f9ee72ffb352f5c1cf30848cdd9893350f2c89692539fc655e0c
|
7
|
+
data.tar.gz: c93f9b168fcc34f6bef5bf1bb41c3cde973c98ed7a7ed83433b7179410c76b2aaa8a1e02a3f2ff4f8a6c042f9685562a33986e51c742c95390433100bc5278c1
|
@@ -72,7 +72,12 @@ module JekyllImport
|
|
72
72
|
if content
|
73
73
|
if use_markdown
|
74
74
|
content = html_to_markdown content
|
75
|
-
|
75
|
+
if add_highlights
|
76
|
+
tumblr_url = URI.parse(post[:slug]).path
|
77
|
+
redirect_dir = tumblr_url.sub(/\//, "") + "/"
|
78
|
+
FileUtils.mkdir_p redirect_dir
|
79
|
+
content = add_syntax_highlights(content, redirect_dir)
|
80
|
+
end
|
76
81
|
end
|
77
82
|
|
78
83
|
File.open("_posts/tumblr/#{post[:name]}", "w") do |f|
|
@@ -132,7 +137,11 @@ module JekyllImport
|
|
132
137
|
title = post["video-title"]
|
133
138
|
content = post["video-player"]
|
134
139
|
unless post["video-caption"].nil?
|
135
|
-
content
|
140
|
+
unless content.nil?
|
141
|
+
content << "<br/>" + post["video-caption"]
|
142
|
+
else
|
143
|
+
content = post["video-caption"]
|
144
|
+
end
|
136
145
|
end
|
137
146
|
when "answer"
|
138
147
|
title = post["question"]
|
@@ -236,7 +245,7 @@ module JekyllImport
|
|
236
245
|
# For example, my code block only contain Python and JavaScript,
|
237
246
|
# so I can assume the block is JavaScript if it contains a
|
238
247
|
# semi-colon.
|
239
|
-
def self.add_syntax_highlights(content)
|
248
|
+
def self.add_syntax_highlights(content, redirect_dir)
|
240
249
|
lines = content.split("\n")
|
241
250
|
block, indent, lang, start = false, /^ /, nil, nil
|
242
251
|
lines.each_with_index do |line, i|
|
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.
|
4
|
+
version: 0.7.0
|
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: 2015-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|