README.md in contentful_middleman-1.0.4 vs README.md in contentful_middleman-1.1.0
- old
+ new
@@ -1,8 +1,8 @@
# Contentful Middleman
-[![Build Status](https://travis-ci.org/contentful/contentful_middleman.png)](https://travis-ci.org/contentful/contentful_middleman)
+[![Build Status](https://travis-ci.org/contentful-labs/contentful_middleman.svg?branch=master)](https://travis-ci.org/contentful-labs/contentful_middleman)
Contentful Middleman is a [Middleman](http://middlemanapp.com/) extension to use the Middleman static site generator together with the API-driven [Contentful CMS](https://www.contentful.com). It is powered by the [Contentful Ruby Gem](https://github.com/contentful/contentful.rb).
Experience the power of Middleman while staying sane as a developer by letting end-users edit content in a web-based interface.
@@ -42,16 +42,17 @@
f.cda_query = QUERY
f.content_types = CONTENT_TYPES_MAPPINGS
end
```
-Parameter | Description
----------- |------------
-space | Hash with an user choosen name for the space as key and the space id as value
-access_token | Contentful Delivery API access token
-cda_query | Hash describing query configuration. See [contentful.rb](https://github.com/contentful/contentful.rb) for more info (look for filter options there)
-content_types | Hash describing the mapping applied to entries of the imported content types
+Parameter | Description
+---------- | ------------
+space | Hash with an user choosen name for the space as key and the space id as value
+access_token | Contentful Delivery API access token
+cda_query | Hash describing query configuration. See [contentful.rb](https://github.com/contentful/contentful.rb) for more info (look for filter options there)
+content_types | Hash describing the mapping applied to entries of the imported content types
+use_preview_api | Boolean to toogle the used API. Set it to `false` to use `cdn.contentful.com` (default value). Set it to `true` to use `preview.contentful.com`. More info in [the documentation](https://www.contentful.com/developers/documentation/content-delivery-api/#preview-api)
You can activate the extension multiple times to import entries from different spaces.
## Entry mapping
The extension will transform every fetched entry before storing it as a yaml file in the local
@@ -79,18 +80,20 @@
```
If you don't want to map all the fields by hand inherit from the Base mappper:
```ruby
-class MyAwesomeMapper < ContentfulMiddleman::Mappers::Base
+class MyAwesomeMapper < ContentfulMiddleman::Mapper::Base
def map(context, entry)
super
# After calling super the context object
# will have a property for every field in the
# entry
end
end
```
+
+There's also an example back-reference mapper in the examples directory for adding back-references onto entries that are linked to by other entries.
## Configuration: examples
```ruby
activate :contentful do |f|