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
Copy file name to clipboardExpand all lines: docs/docs/creating-and-modifying-pages.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ Gatsby makes it easy to programmatically control your pages.
6
6
7
7
Pages can be created in three ways:
8
8
9
-
- In your site's gatsby-node.js by implementing the API
10
-
[`createPages`](/docs/node-apis/#createPages)
11
-
- Gatsby core automatically turns React components in `src/pages/*` into pages. Note that you must make the component the [default export](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export)
12
-
- Plugins can also implement `createPages` and create pages for you
9
+
- By creating React components in the `src/pages` directory. (Note that you must make the component the [default export](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export).)
10
+
- By using the [File System Route API](/docs/file-system-route-api/) to programmatically create pages from GraphQL and to create client-only routes.
11
+
- In your site's `gatsby-node.js` file, by implementing the API [`createPages`](/docs/node-apis/#createPages). ([Plugins](/docs/plugins/) can also implement `createPages` and create pages for you.)
13
12
14
-
You can also implement the API [`onCreatePage`](/docs/node-apis/#onCreatePage)
15
-
to modify pages created in core or plugins or to create [client-only routes](/docs/client-only-routes-and-user-authentication/).
13
+
Pages can also be modified by you after their creation. For example, you could change the `path` to create internationalized routes (see [gatsby-theme-i18n](https://github.com/gatsbyjs/themes/blob/1ddd07c4248239e6323833c6d6d572ac0a0d57a1/packages/gatsby-theme-i18n/gatsby-node.js#L132-L172) for instance) by implementing the API [`onCreatePage`](/docs/node-apis/#onCreatePage).
14
+
15
+
> **Note:** For most use cases you'll be able to use the [File System Route API](/docs/file-system-route-api/) to create pages. Please read on if you need more control over the page creation or consume data outside of Gatsby's GraphQL data layer.
16
16
17
17
## Debugging help
18
18
@@ -264,6 +264,6 @@ export default Page
264
264
265
265
Page context is serialized before being passed to pages. This means it can't be used to pass functions into components and `Date` objects will be serialized into strings.
266
266
267
-
## Creating Client-only routes
267
+
## Creating client-only routes
268
268
269
-
In specific cases, you might want to create a site with client-only portions that are gated by authentication. For more on how to achieve this, refer to [client-only routes & user authentication](https://www.gatsbyjs.com/docs/client-only-routes-and-user-authentication/).
269
+
In specific cases, you might want to create a site with client-only portions that are gated by authentication. For more on how to achieve this, refer to [client-only routes & user authentication](/docs/client-only-routes-and-user-authentication/).
0 commit comments