jekyll-contentful-data-import 1.5.0 → 1.5.1

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: b070683edf1ce2aaac689f088b6913804b8cc6be
4
- data.tar.gz: 957112e98c2d0318336e8b709a1900c9a9fc752c
3
+ metadata.gz: d3f3bfe77c63cdbb2428c0e4ad7ec8ce5fcd85d7
4
+ data.tar.gz: 6b611233877a8275d952ec8ac49a1aecc55ff2fb
5
5
  SHA512:
6
- metadata.gz: c2ddbe6c4e3a7bfb1d85de3f720100e4d3603b1b573647f9f5419da341cbea327df443e112f894f25568a9496374b314a40943ef57b03518d7c97ed4f17ea0e7
7
- data.tar.gz: f01b63f3eef1da47fb685eb713ce44d03ed30d2a7ee5cb969f0a17d9d19a97aaf17aa42732bafdae54ddcfc31d68633c432213e976508c6b4e442cef608115d8
6
+ metadata.gz: a51238cb49f031d904ac24b87e2ca9ba102a73d617cba54f756aea1315682ff737c1bfe67f3f47c0475048b6f8a1f134d4ededc3128dfcb19cbe99e80fcf608e
7
+ data.tar.gz: 1a8f633a2f9b6dfa747137778f46a724f0dbc63435705c70580b1fe0ab4cac5a5207337dc2711b964aaad380686f918c425aba143d9fefe0c57a247079fd0767
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.5.1
6
+ ### Fixed
7
+ * Fixed wrong serialization for Location fields
8
+
5
9
  ## v1.5.0
6
10
 
7
11
  ### Changed
data/README.md CHANGED
@@ -83,19 +83,19 @@ The default mapper will map fields, assets and linked entries.
83
83
  You can create your own mappers if you need to. The only requirement for a class to behave as a
84
84
  mapper is to have a `map` instance method.
85
85
 
86
- Following is an example of such custom mapper that adds all `sys` properties to the entry:
86
+ Following is an example of such custom mapper that reverses all entry field IDs:
87
87
 
88
88
  ```ruby
89
- class MySysMapper < ::Jekyll::Contentful::Mappers::Base
89
+ class MyReverseMapper < ::Jekyll::Contentful::Mappers::Base
90
90
  def map
91
91
  result = super
92
+ reversed_result = {}
92
93
 
93
- entry.sys.each do |k, v|
94
- name, value = map_field k, v
95
- result['sys'][name] = value
94
+ result.each do |k, v|
95
+ reversed_result[k.reverse] = v
96
96
  end
97
97
 
98
- result
98
+ reversed_result
99
99
  end
100
100
  end
101
101
  ```
@@ -123,7 +123,7 @@ Then proceed to run: `bundle exec rake contentful`
123
123
  In most cases you may want to avoid including your credentials in publicly available sites,
124
124
  therefore you can do the following:
125
125
 
126
- 1. `bundle update`—make sure your gem version supports `ENV_` variables
126
+ 1. `bundle update` — make sure your gem version supports `ENV_` variables
127
127
 
128
128
  2. Set up your `_config` like so:
129
129
 
@@ -131,11 +131,10 @@ module Jekyll
131
131
  end
132
132
 
133
133
  def map_location(location)
134
- result = {}
135
- location.properties.each do |k, v|
136
- result[k.to_s] = v
137
- end
138
- result
134
+ {
135
+ 'lat' => location.latitude,
136
+ 'lon' => location.longitude
137
+ }
139
138
  end
140
139
 
141
140
  def map_link(link)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Contentful
3
- VERSION = '1.5.0'.freeze
3
+ VERSION = '1.5.1'.freeze
4
4
  end
5
5
  end
@@ -61,14 +61,12 @@ describe Jekyll::Contentful::Mappers::Base do
61
61
  end
62
62
 
63
63
  class LocationDouble < Contentful::Location
64
+ attr_reader :lat, :lon
65
+
64
66
  def initialize(lat, lon)
65
67
  @lat = lat
66
68
  @lon = lon
67
69
  end
68
-
69
- def properties
70
- { 'lat' => @lat, 'lon' => @lon }
71
- end
72
70
  end
73
71
 
74
72
  class LinkDouble < Contentful::Link
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-contentful-data-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Contentful GmbH