@Elryco's answer is close, but not entirely correct, at least for my installation. It took a few trial and error, but in the end it worked.
Please note that you need the jekyll-contentful-data-import gem (v1.7.0 or higher) for this solution to work.
Bash environment (e.g. ~/.bash_profile ):
export CONTENTFUL_ACCESS_TOKEN=foo export CONTENTFUL_SPACE_ID=bar
In _config.yml specify them as:
contentful: spaces: - example: space: ENV_CONTENTFUL_SPACE_ID access_token: ENV_CONTENTFUL_ACCESS_TOKEN
This is the same as written in the Github documentation.
source share