You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To create your first Gatsby site, you're going to use a command from the Gatsby command line interface (CLI): `gatsby new`. This command brings up an interactive prompt that asks you questions about the site you want to build. After you enter all the information, the CLI uses your answers to automatically generate your new Gatsby site.
@@ -68,11 +75,13 @@ npm install -g gatsby-cli
68
75
Let's take a closer look at the process:
69
76
70
77
1. Open the command line, and use the `cd` command to change directories into the folder where you want to create your new Gatsby site. For example, if you wanted to create your new site on your desktop, you might type:
78
+
71
79
```shell
72
80
cd Desktop
73
81
```
74
82
75
83
2. Run the following command from the command line. This will start up the interactive prompt to help you create a new Gatsby site.
84
+
76
85
```shell:title=Desktop
77
86
gatsby new
78
87
```
@@ -84,18 +93,21 @@ gatsby new
84
93
</Announcement>
85
94
86
95
3. When the prompt asks, **"What would you like to call your site?"** enter a name for your site.
96
+
87
97
```shell
88
98
What would you like to call your site?
89
99
✔ · My First Gatsby Site
90
100
```
91
101
92
102
4. When the prompt asks, **"What would you like to name the folder where your site will be created?"** use the default folder name, which will be based on the site name you chose.
103
+
93
104
```shell
94
105
What would you like to name the folder where your site will be created?
95
106
✔ Desktop/ my-first-gatsby-site
96
107
```
97
108
98
109
5. When the prompt asks, **"Will you be using a CMS?"** select **"No (or I'll add it later)"**.
110
+
99
111
```shell
100
112
✔ Will you be using a CMS?
101
113
· No (or I'll add it later)
@@ -110,6 +122,7 @@ But in this first site, you'll set things up manually to learn about how Gatsby'
110
122
</Announcement>
111
123
112
124
6. When the prompt asks, **"Would you like to install a styling system?"**select**"No (or I'll add it later)"**. (You'll add styles manually later.)
125
+
113
126
```shell
114
127
✔ Would you like to install a styling system?
115
128
· No (or I'll add it later)
@@ -123,6 +136,7 @@ But in this first site, you'll set things up manually to learn about how Gatsby'
123
136
```
124
137
125
138
8. The prompt will show you a summary of what `gatsby new` will do. It should look something like the output below.
139
+
126
140
```shell
127
141
Thanks! Here's what we'll now do:
128
142
@@ -133,6 +147,7 @@ Thanks! Here's what we'll now do:
133
147
```
134
148
135
149
9. When the prompt asks, **"Shall we do this?"** enter **"Y"**. The `gatsby new` command will start building your site. Your internet download speed will affect how long this command takes to run. After it finishes, you should see a message like this:
150
+
136
151
```shell
137
152
🎉 Your new Gatsby site My First Gatsby Site has been successfully
138
153
created at ~/Desktop/my-first-gatsby-site.
@@ -160,6 +175,7 @@ The **development server** is a useful tool for when you're working on your site
160
175
To start up your development server, do the following:
161
176
162
177
1. In the command line, change into the directory you created for your site:
178
+
163
179
```shell:title=~/Desktop
164
180
cd my-first-gatsby-site
165
181
```
@@ -171,6 +187,7 @@ cd my-first-gatsby-site
171
187
</Announcement>
172
188
173
189
2. From your site directory, start the development server by running the following command:
190
+
174
191
```shell:title=~/Desktop/my-first-gatsby-site
175
192
gatsby develop
176
193
```
@@ -222,7 +239,7 @@ GitHub is a website that many developers use to back up and share their code onl
222
239
223
240
2. When filling out the form for your new repo, you can make it public or private. (This only affects the visibility of your code on GitHub. Your site will still be visible to everyone once you deploy it with Gatsby Cloud.) Leave the initialization option checkboxes unchecked.
224
241
225
-

242
+

226
243
227
244
3. To push your existing code from your computer to your new GitHub repository, enter the commands below in the command line. Be sure to swap out `YOUR_GITHUB_USERNAME`for your actual username and `YOUR_GITHUB_REPO_NAME` with the name you gave your GitHub repo (like `my-first-gatsby-site`).
228
245
@@ -254,47 +271,37 @@ To connect your code on GitHub to your Gatsby Cloud account, do the following:
1. The next few steps will help you add your site to Gatsby Cloud. First, select **"Import from a Git repository"** and click the **"Next"** button at the bottom of the page.
258
-
259
-

274
+
1. The next few steps will help you add your site to Gatsby Cloud. First, in the **"Import from a Git repository"** card click the **"GitHub"** icon to select GitHub as your Git provider.
260
275
261
-
1. Select **GitHub** as the Git provider.
276
+

262
277
263
-

264
-
265
-
1. If this is your first time connecting GitHub to Gatsby Cloud, you'll need to give Gatsby Cloud permission to access your GitHub account. When asked, **"Where should we host this new project?"** click the **"Select destination"** button.
278
+
1. If this is your first time connecting GitHub to Gatsby Cloud, you'll need to give Gatsby Cloud permission to access your GitHub account.
266
279
267
280
<Announcement style={{marginBottom: "1.5rem"}}>
268
281
269
-
**Note:** If you are part of more than one GitHub organization, you will need to first selectthe organization with which the repository resides at this step before selecting the repository itself.
282
+
**Note:** If you are part of more than one GitHub organization, you will need to first selectthe organization with which the repository resides at this step before selecting the repository itself.
270
283
271
284
</Announcement>
272
285
273
-

274
-
275
286
1. A new browser window should open, where GitHub will ask you whether you want to give Gatsby Cloud permission to your GitHub repositories. You can choose whether to give Gatsby Cloud access to all of your GitHub repositories or to only the repository you created (`my-first-gatsby-site`). Then click **"Install"**.
276
287
277
-

278
-
279
-
1. Now, when you go back to the Gatsby Cloud window, the **"Select a Repository"** dropdown should list your GitHub repository. Select it.
280
-
281
-

288
+

282
289
283
-
1. Once you selectyour repo, a few more input fields will show up. These let you tell Gatsby Cloud where to look in your GitHub repo foryour Gatsby site. You can also change what Gatsby Cloud will name your site. **Leave the default settings** and click the **"Next"** button.
290
+
1. Now, when you go back to the Gatsby Cloud window, the repository list should contain your GitHub repository. Select it.
284
291
285
-

292
+

286
293
287
-
1. Gatsby Cloud will ask youifyou want to add any optional integrations to your site. For future projects, this might be useful if you want to use a CMS. But for now, click the **"Skip this step"** button.
294
+
1. Once you selectyour repo, you'll be navigated to the configuration step which presents you with a few more inputs. These let you tell Gatsby Cloud where to look in your GitHub repo for your Gatsby site. You can also change what Gatsby Cloud will name your site. **Leave the default settings** and click the **"Next"** button.
288
295
289
-

296
+

290
297
291
-
1. Gatsby Cloud will also ask if you want to add any environment variables. Skip this section, and click the **"Create site"** button.
298
+
1. Gatsby Cloud will ask you if you want to add any integrations to your site. For future projects, this might be useful if you want to use a CMS. Gatsby Cloud will also ask if you want to add any environment variables. Again, this may useful for future projects, but for now, scroll past and click the **"Build Site"** button.
292
299
293
-

300
+

294
301
295
302
1. Now that your site has been created, you'll be taken to a site dashboard where you can see the status of your builds. Gatsby Cloud should start building your site automatically. You'll see a link to your new site, which is automatically hosted on Gatsby Cloud. You can share this link with anyone, and they'll be able to see your site online!
296
303
297
-

304
+

298
305
299
306
You did it! Your Gatsby site is now online! 👏
300
307
@@ -326,10 +333,10 @@ First, you write the code for your Gatsby site from your computer. When you're r
326
333
327
334
### Key takeaways
328
335
329
-
* To create a new Gatsby site from the command line, you can run the `gatsby new` command.
330
-
* To run your site locally, use the `gatsby develop` command. You can view your site in a web browser at `localhost:8000`.
331
-
* Gatsby Cloud is an infrastructure platform specifically optimized for building, deploying, and hosting Gatsby sites.
332
-
* When you push a new commit to the `main` branch of the GitHub repository for your site, Gatsby Cloud will detect the changes, rebuild a new version of your site, and then redeploy it.
336
+
- To create a new Gatsby site from the command line, you can run the `gatsby new` command.
337
+
- To run your site locally, use the `gatsby develop` command. You can view your site in a web browser at `localhost:8000`.
338
+
- Gatsby Cloud is an infrastructure platform specifically optimized for building, deploying, and hosting Gatsby sites.
339
+
- When you push a new commit to the `main` branch of the GitHub repository for your site, Gatsby Cloud will detect the changes, rebuild a new version of your site, and then redeploy it.
0 commit comments