Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env readme update #149

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .contentful.json.sample

This file was deleted.

2 changes: 2 additions & 0 deletions .env.development.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONTENTFUL_SPACE_ID='...'
CONTENTFUL_ACCESS_TOKEN='...'
2 changes: 2 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONTENTFUL_SPACE_ID='...'
CONTENTFUL_ACCESS_TOKEN='...'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env
.env*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the .env files that are created were not being ignored in commits because they didn't match the .env pattern, so I updated this and then added negating patterns for the sample files below.

!.env.production.sample
!.env.development.sample

# build folder
public
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 config files (`./.env.production` and `./.env.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.development.sample` to `.env.development` and add your configuration in this file. You can do this for `.env.production.sample` as well.

## Crucial Commands

Expand Down
2 changes: 1 addition & 1 deletion bin/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thanks for giving the ${pkg.name} a try. 🎉
To get you going really quickly this project includes a setup step.

${chalk.yellow.bold("npm run setup")} automates the following steps for you:
- creates a config file ${chalk.yellow("./.contentful.json")}
- creates config files: ${chalk.yellow("./.env.production, ./.env.development")}
- imports ${chalk.green("a predefined content model")}

When this is done run:
Expand Down