jekyll-import 0.5.3 → 0.6.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/LICENSE +3 -3
- data/lib/jekyll-import/importers/drupal7.rb +8 -7
- data/lib/jekyll-import/importers/wordpressdotcom.rb +5 -0
- 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: fc7406feefb90f863da53e19f16b1332df9cc517
|
4
|
+
data.tar.gz: d489c2861991abd91d233bfd453893240ddb0764
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344444bad905756c1048ac045cc867024837dc9aa48e88062838cb09cb61641969326fa9e6df1e5e8a36d8a068d58acb012dde471a8b5cedce07988d8d02da13
|
7
|
+
data.tar.gz: bb57faf4b37239f021ab7b0e6578457896c8fbed3d5bf5f53540b4976f27d60bc017d6aca002fbf7195dba821bd3053ff5b0b9f04ce8046f884fd7a56d3fb08c
|
data/LICENSE
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
3
|
Copyright (c) 2013 Tom Preston-Werner
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
7
|
in the Software without restriction, including without limitation the rights
|
8
8
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
@@ -12,7 +12,7 @@ furnished to do so, subject to the following conditions:
|
|
12
12
|
The above copyright notice and this permission notice shall be included in all
|
13
13
|
copies or substantial portions of the Software.
|
14
14
|
|
15
|
-
THE SOFTWARE IS PROVIDED
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
@@ -3,9 +3,9 @@ module JekyllImport
|
|
3
3
|
class Drupal7 < Importer
|
4
4
|
# Reads a MySQL database via Sequel and creates a post file for each story
|
5
5
|
# and blog node.
|
6
|
-
QUERY = "SELECT n.
|
7
|
-
n.title, \
|
6
|
+
QUERY = "SELECT n.title, \
|
8
7
|
fdb.body_value, \
|
8
|
+
fdb.body_summary, \
|
9
9
|
n.created, \
|
10
10
|
n.status \
|
11
11
|
FROM node AS n, \
|
@@ -59,9 +59,9 @@ module JekyllImport
|
|
59
59
|
|
60
60
|
db[QUERY].each do |post|
|
61
61
|
# Get required fields and construct Jekyll compatible name
|
62
|
-
node_id = post[:nid]
|
63
62
|
title = post[:title]
|
64
63
|
content = post[:body_value]
|
64
|
+
summary = post[:body_summary]
|
65
65
|
created = post[:created]
|
66
66
|
time = Time.at(created)
|
67
67
|
is_published = post[:status] == 1
|
@@ -72,10 +72,11 @@ module JekyllImport
|
|
72
72
|
# Get the relevant fields as a hash, delete empty fields and convert
|
73
73
|
# to YAML for the header
|
74
74
|
data = {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
'layout' => 'post',
|
76
|
+
'title' => title.to_s,
|
77
|
+
'created' => created,
|
78
|
+
'excerpt' => summary
|
79
|
+
}.delete_if { |k,v| v.nil? || v == ''}.to_yaml
|
79
80
|
|
80
81
|
# Write out the data and content to file
|
81
82
|
File.open("#{dir}/#{name}", "w") do |f|
|
@@ -117,6 +117,11 @@ module JekyllImport
|
|
117
117
|
|
118
118
|
begin
|
119
119
|
content = Hpricot(item.at('content:encoded').inner_text)
|
120
|
+
excerpt = Hpricot(item.at('excerpt:encoded').inner_text)
|
121
|
+
|
122
|
+
if excerpt
|
123
|
+
header['excerpt'] = excerpt
|
124
|
+
end
|
120
125
|
|
121
126
|
if fetch
|
122
127
|
download_images(title, content, assets_folder)
|
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.6.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:
|
11
|
+
date: 2015-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|