Gatsby automatically turns React components located in src/pages
into pages with URLs.
This video will show you:
src/pages
to automatically create new pages in Gatsby.Amberley Romo: [00:00] I've already created the new Gatsby site using the Gatsby default starter. I'm running it locally. The default starter ships with a few pages already defined, as examples. Over here, you can see the index page.
[00:12] Over in our code, if we open up site, then source, then pages, and then this index.js file, this component is actually what's creating what you see here on the index page. Hi, people.
[00:30] Let's create a new page, just for example. We'll make it an about page and we'll just add a little bit of example content.
[00:49] Now, if we go back over here to our site running in development, and we hit the about route, we'll see this content that we just put into this component, in this about.js file. Gatsby will automatically turn any file in the source pages directory into a page.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!