From a0f7241402ac5171236fc44f8b0e0e9c56777c65 Mon Sep 17 00:00:00 2001 From: David Larrabee Date: Fri, 16 Apr 2021 09:52:38 -0400 Subject: [PATCH] Updates readme to better describe after setup process - setup now writes .env files versus a json config - updates .gitignore to exclude files that should be kept from source - changes sample file to match current setup output --- .contentful.json.sample | 4 ---- .env.sample | 2 ++ .gitignore | 6 +++++- README.md | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 .contentful.json.sample create mode 100644 .env.sample 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