Skip to content

Commit 08ce379

Browse files
aghreedrmatambo8
andauthored
Update tutorial part 1 to reflect changes to add site flow (#34427)
* update imagery and instructions in tutorial to reflect updated add site flow * update indentation Co-authored-by: Rodney Matambo <[email protected]>
1 parent db188dc commit 08ce379

14 files changed

+39
-32
lines changed
Loading
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
803 KB
Loading
Binary file not shown.
-720 KB
Binary file not shown.
-686 KB
Binary file not shown.

docs/docs/tutorial/part-1/index.mdx

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: "Part 1: Create and Deploy Your First Gatsby Site"
33
---
44

5-
import { Announcement, LinkButton } from 'gatsby-interface'
6-
import Collapsible from '@components/collapsible'
7-
import { MdArrowForward } from 'react-icons/md'
5+
import { Announcement, LinkButton } from "gatsby-interface"
6+
import Collapsible from "@components/collapsible"
7+
import { MdArrowForward } from "react-icons/md"
88

99
## Introduction
1010

@@ -38,11 +38,18 @@ If you'd rather follow along with a video, here's a recording of a livestream th
3838

3939
You can catch the stream live on Wednesdays at 10AM Pacific Time / 5PM UTC on the [Gatsby Twitch channel](https://www.twitch.tv/gatsbyjs).
4040

41-
<iframe width="560" height="315" src="https://www.youtube.com/embed/wr8rbaHUM6Q?start=470" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
41+
<iframe
42+
width="560"
43+
height="315"
44+
src="https://www.youtube.com/embed/wr8rbaHUM6Q?start=470"
45+
title="YouTube video player"
46+
frameborder="0"
47+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
48+
allowfullscreen
49+
></iframe>
4250

4351
</Announcement>
4452

45-
4653
## Create a Gatsby site
4754

4855
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
6875
Let's take a closer look at the process:
6976

7077
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+
7179
```shell
7280
cd Desktop
7381
```
7482

7583
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+
7685
```shell:title=Desktop
7786
gatsby new
7887
```
@@ -84,18 +93,21 @@ gatsby new
8493
</Announcement>
8594

8695
3. When the prompt asks, **"What would you like to call your site?"** enter a name for your site.
96+
8797
```shell
8898
What would you like to call your site?
8999
✔ · My First Gatsby Site
90100
```
91101

92102
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+
93104
```shell
94105
What would you like to name the folder where your site will be created?
95106
✔ Desktop/ my-first-gatsby-site
96107
```
97108

98109
5. When the prompt asks, **"Will you be using a CMS?"** select **"No (or I'll add it later)"**.
110+
99111
```shell
100112
✔ Will you be using a CMS?
101113
· 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'
110122
</Announcement>
111123

112124
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+
113126
```shell
114127
✔ Would you like to install a styling system?
115128
· 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'
123136
```
124137
125138
8. The prompt will show you a summary of what `gatsby new` will do. It should look something like the output below.
139+
126140
```shell
127141
Thanks! Here's what we'll now do:
128142
@@ -133,6 +147,7 @@ Thanks! Here's what we'll now do:
133147
```
134148
135149
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+
136151
```shell
137152
🎉 Your new Gatsby site My First Gatsby Site has been successfully
138153
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
160175
To start up your development server, do the following:
161176
162177
1. In the command line, change into the directory you created for your site:
178+
163179
```shell:title=~/Desktop
164180
cd my-first-gatsby-site
165181
```
@@ -171,6 +187,7 @@ cd my-first-gatsby-site
171187
</Announcement>
172188
173189
2. From your site directory, start the development server by running the following command:
190+
174191
```shell:title=~/Desktop/my-first-gatsby-site
175192
gatsby develop
176193
```
@@ -222,7 +239,7 @@ GitHub is a website that many developers use to back up and share their code onl
222239
223240
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.
224241
225-
![The GitHub form to create a new repository. It's set to create a public repo called "my-first-gatsby-site". The options to add a README, .gitignore file, and license are unchecked.](./new-repo-options.png)
242+
![The GitHub form to create a new repository. It's set to create a public repo called "my-first-gatsby-site". The options to add a README, .gitignore file, and license are unchecked.](./new-repo-options.png)
226243
227244
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`).
228245
@@ -254,47 +271,37 @@ To connect your code on GitHub to your Gatsby Cloud account, do the following:
254271
255272
![An empty Gatsby Cloud dashboard](./01-create-a-site-button.png)
256273
257-
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-
![The "Add a site" screen. The option for "Import from a Git repository" is selected.](./02-import-a-git-repo.png)
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.
260275
261-
1. Select **GitHub** as the Git provider.
276+
![The "Add a site" screen. Select the option for "Import from a Git repository".](./02-import-a-git-repo.png)
262277
263-
![The "Git provider" tab of the "Add a site" screen. It lists two options: GitHub or GitLab.](./03-select-a-git-provider.png)
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.
266279
267280
<Announcement style={{marginBottom: "1.5rem"}}>
268281
269-
**Note:** If you are part of more than one GitHub organization, you will need to first select the 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 select the organization with which the repository resides at this step before selecting the repository itself.
270283
271284
</Announcement>
272285
273-
![The "Repository" tab of the "Add a site" screen.](./04-select-destination.png)
274-
275286
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"**.
276287
277-
![The GitHub permissions page, asking whether you want to give Gatsby Cloud access to your repos. The "All repositories" option is selected.](./05-github-gatsby-cloud-permissions.png)
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-
![The "Select a Repository" dropdown in Gatsby Cloud lists the "my-first-gatsby-site" GitHub repository.](06-select-repository.png)
288+
![The GitHub permissions page, asking whether you want to give Gatsby Cloud access to your repos. The "All repositories" option is selected.](./03-github-gatsby-cloud-permissions.png)
282289
283-
1. Once you select your repo, a few more input fields will show up. 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.
290+
1. Now, when you go back to the Gatsby Cloud window, the repository list should contain your GitHub repository. Select it.
284291
285-
![The new fields. "Base Branch" is set to "main", "Base Directory" is set to "/", and "Site Name" is set to "my-first-gatsby-site-main".](./07-add-site-details.png)
292+
![The "Select a Repository" dropdown in Gatsby Cloud lists the "my-first-gatsby-site" GitHub repository.](04-select-repository.png)
286293
287-
1. Gatsby Cloud will ask you if you 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 select your 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.
288295
289-
![The "Integrations" tab of the "Add a site" screen.](./08-optional-integrations.png)
296+
![The new fields. "Base Branch" is set to "main", "Base Directory" is set to "/", and "Site Name" is set to "my-first-gatsby-site-main".](./05-add-site-details.png)
290297
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.
292299
293-
![The "Setup" tab of the "Add a site" screen.](./09-setup.png)
300+
![The "Integrations" tab of the "Add a site" screen.](./06-integrations-and-environment-variables.png)
294301
295302
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!
296303
297-
![The Gatsby Cloud dashboard for a new site.](./10-site-page.png)
304+
![The Gatsby Cloud dashboard for a new site.](./07-site-page.png)
298305
299306
You did it! Your Gatsby site is now online! 👏
300307
@@ -326,10 +333,10 @@ First, you write the code for your Gatsby site from your computer. When you're r
326333
327334
### Key takeaways
328335
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.
333340
334341
<Announcement style={{marginBottom: "1.5rem"}}>
335342

0 commit comments

Comments
 (0)