jekyll-contentful-data-import 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +7 -7
- data/lib/jekyll-contentful-data-import/importer.rb +10 -1
- data/lib/jekyll-contentful-data-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: 16c03521fa21f10014b5e71459b53865e1da9aac
|
4
|
+
data.tar.gz: 53ef74f05c7123a7af50fb683f6f1c8db943740c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27be80ec515ad6464e1ef00414a4a9e86c893ba1a535b5823980cce0eaadeb7572ee391125ee56c1f444e31701f351d3c625a029a69899d78aeaf77c663f28e2
|
7
|
+
data.tar.gz: 228eb4426ad9bd597dff4f064a290683621925ea928b3e1eaae74157743cc13552232991ec144924b4e5004212d1be6aa3c2bb75a95a1cde4fcdae0ca0964128
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
## Unreleased
|
3
3
|
|
4
|
+
## v1.2.1
|
5
|
+
### Fixed
|
6
|
+
* README showing incorrect configuration [#5](https://github.com/contentful/jekyll-contentful-data-import/issues/5)
|
7
|
+
* `client_options` being incorrectly parsed and allowing overriding parameters that should be fixed
|
8
|
+
|
4
9
|
## v1.2.0
|
5
10
|
### Added
|
6
11
|
* Customizable Data Path [#1](https://github.com/contentful/jekyll-contentful-data-import/issues/1)
|
data/README.md
CHANGED
@@ -6,11 +6,13 @@ Jekyll-Contentful-Data-Import is a [Jekyll](http://jekyllrb.com/) extension to u
|
|
6
6
|
|
7
7
|
Experience the power of Jekyll while staying sane as a developer by letting end-users edit content in a web-based interface.
|
8
8
|
|
9
|
-
|
10
9
|
## Installation
|
11
|
-
|
10
|
+
|
11
|
+
Create a Gemfile in your Jekyll project and add the following:
|
12
12
|
|
13
13
|
```ruby
|
14
|
+
source 'https://rubygems.org'
|
15
|
+
|
14
16
|
group :jekyll_plugins do
|
15
17
|
gem "jekyll-contentful-data-import"
|
16
18
|
end
|
@@ -48,9 +50,7 @@ contentful:
|
|
48
50
|
content_types: # Optional
|
49
51
|
cat: MyCoolMapper
|
50
52
|
client_options: # Optional
|
51
|
-
:preview
|
52
|
-
:raise_errors: true
|
53
|
-
:dynamic_entries: :auto
|
53
|
+
api_url: 'preview.contentful.com' # Defaults to 'api.contentful.com' which is Production
|
54
54
|
base_path: app_path # Optional - Defaults to Current directory
|
55
55
|
|
56
56
|
```
|
@@ -75,7 +75,7 @@ The default mapper will map fields, assets and linked entries.
|
|
75
75
|
|
76
76
|
### Custom Mappers
|
77
77
|
|
78
|
-
You can create your own mappers if you need
|
78
|
+
You can create your own mappers if you need to. The only requirement for a class to behave as a
|
79
79
|
mapper is to have a `map` instance method.
|
80
80
|
|
81
81
|
Following is an example of such custom mapper that adds all `sys` properties to the entry:
|
@@ -97,7 +97,7 @@ end
|
|
97
97
|
|
98
98
|
#### Caveats
|
99
99
|
|
100
|
-
Jekyll itself only allows to import code as plugins only for
|
100
|
+
Jekyll itself only allows you to import code as plugins only for its recognized plugin entry points.
|
101
101
|
Therefore we need to use a custom [Rakefile](https://github.com/contentful/contentful_jekyll_examples/blob/master/examples/custom_mapper/example/Rakefile) to import the mapper and required files:
|
102
102
|
|
103
103
|
```ruby
|
@@ -15,7 +15,7 @@ module Jekyll
|
|
15
15
|
space_client = client(
|
16
16
|
options['space'],
|
17
17
|
options['access_token'],
|
18
|
-
options.fetch('client_options', {})
|
18
|
+
client_options(options.fetch('client_options', {}))
|
19
19
|
)
|
20
20
|
|
21
21
|
Jekyll::Contentful::DataExporter.new(
|
@@ -40,6 +40,15 @@ module Jekyll
|
|
40
40
|
|
41
41
|
::Contentful::Client.new(options)
|
42
42
|
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def client_options(options)
|
47
|
+
options = options.each_with_object({}){|(k,v), memo| memo[k.to_sym] = v; memo}
|
48
|
+
options.delete(:dynamic_entries)
|
49
|
+
options.delete(:raise_errors)
|
50
|
+
options
|
51
|
+
end
|
43
52
|
end
|
44
53
|
end
|
45
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-contentful-data-import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|