diff --git a/.contentful.json.sample b/.contentful.json.sample deleted file mode 100644 index 6a2368fa..00000000 --- a/.contentful.json.sample +++ /dev/null @@ -1,4 +0,0 @@ -{ - "spaceId": "...", - "accessToken": "..." -} diff --git a/.env.sample b/.env.sample new file mode 100644 index 00000000..c1a9120a --- /dev/null +++ b/.env.sample @@ -0,0 +1,2 @@ +CONTENTFUL_SPACE_ID='...' +CONTENTFUL_ACCESS_TOKEN='...' diff --git a/.gitignore b/.gitignore index 502e9e44..6ff9ed17 100644 --- a/.gitignore +++ b/.gitignore @@ -66,4 +66,8 @@ public # contentful config file .contentful.json # Local Netlify folder -.netlify \ No newline at end of file +.netlify + +# enviornment files created by `npm run setup` +.env.* +!.env.sample \ No newline at end of file diff --git a/README.md b/README.md index 7d771822..7d4de5f7 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ $ gatsby new contentful-starter-blog https://github.com/contentful/starter-gatsb This project comes with a Contentful setup command `npm run setup`. -This command will ask you for a space ID, and access tokens for the Contentful Management and Delivery API and then import the needed content model into the space you define and write a config file (`./.contentful.json`). +This command will ask you for a space ID, and access tokens for the Contentful Management and Delivery API and then import the needed content model into the space you define and write a config files (`.env.production` and `.enf.development`). -`npm run setup` automates that for you but if you want to do it yourself rename `.contentful.json.sample` to `.contentful.json` and add your configuration in this file. +`npm run setup` automates that for you but if you want to do it yourself rename `.env.sample` to `.env.development` and add your configuration in this file. ## Crucial Commands