jekyll-import 0.5.3 → 0.6.0

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: 855c5e36be4360af072339df9731c697be2d2fc7
4
- data.tar.gz: f3cdbed992f885c71821ce3c2e97497ef6e7253b
3
+ metadata.gz: fc7406feefb90f863da53e19f16b1332df9cc517
4
+ data.tar.gz: d489c2861991abd91d233bfd453893240ddb0764
5
5
  SHA512:
6
- metadata.gz: 284cb23924967d43155a095931c95cee8548e29a12cca3c1feef5d77debdae194dacfcb6a9de939ac933869592053d242086ffb6d392ea1701a73027fff98758
7
- data.tar.gz: 8c1e96ca71c5b83ac2df39d424351d287c910cc431ca85f2ed5c7b0d9d27bc34ca291413a785e9ef778a6ecd156c4f86f92def3d8370782500c172dde7e6c6a2
6
+ metadata.gz: 344444bad905756c1048ac045cc867024837dc9aa48e88062838cb09cb61641969326fa9e6df1e5e8a36d8a068d58acb012dde471a8b5cedce07988d8d02da13
7
+ data.tar.gz: bb57faf4b37239f021ab7b0e6578457896c8fbed3d5bf5f53540b4976f27d60bc017d6aca002fbf7195dba821bd3053ff5b0b9f04ce8046f884fd7a56d3fb08c
data/LICENSE CHANGED
@@ -1,9 +1,9 @@
1
- (The MIT License)
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 'Software'), to deal
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 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
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.nid, \
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
- 'layout' => 'post',
76
- 'title' => title.to_s,
77
- 'created' => created,
78
- }.delete_if { |k,v| v.nil? || v == ''}.to_yaml
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)
@@ -1,3 +1,3 @@
1
1
  module JekyllImport
2
- VERSION = '0.5.3'
2
+ VERSION = '0.6.0'
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.3
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: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll