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

chore(docs): Adjust doc mentions of gatsby-plugin-create-client-paths #34424

Merged
merged 1 commit into from
Jan 7, 2022
Merged
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
2 changes: 0 additions & 2 deletions docs/docs/gatsby-internals-terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Contains a map of Page [path](#path) -> [Page object](#page-object).

Think of this instead as `client matchPath`. It is ignored when creating pages during the build. But on the frontend, when resolving the page from the path ([find-path.js]()), it is used (via [reach router](https://github.com/reach/router/blob/master/src/lib/utils.js)) to find the matching page. Note that the [pages are sorted](https://github.com/gatsbyjs/gatsby/blob/7d6a0aa47b37f39aafd7c7b1debfe2cc88c5d540/packages/gatsby/src/bootstrap/requires-writer.ts#L154) so that those with matchPaths are at the end, so that explicit paths are matched first.

This is also used by [gatsby-plugin-create-client-paths](/plugins/gatsby-plugin-create-client-paths/?=client). It duplicates pages whose path match some client-only prefix (e.g. `/app/`). The duplicated page has a `matchPath` so that it is resolved first on the frontend.

It is also used by [gatsby-plugin-netlify](/plugins/gatsby-plugin-netlify/?=netlify) when creating `_redirects`.

#### jsonName
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/page-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ The `components` Redux namespace is a map of [componentPath](/docs/behind-the-sc

## onCreatePage API

Every time a page is created, plugins have the opportunity to handle its [onCreatePage](/docs/reference/config-files/gatsby-node/#onCreatePage) event. This is used for things like creating `SitePage` nodes in [Internal Data Bridge](/docs/internal-data-bridge/), and for "path" related plugins such as [gatsby-plugin-create-client-paths](/plugins/gatsby-plugin-create-client-paths/) and [gatsby-plugin-remove-trailing-slashes](/plugins/gatsby-plugin-remove-trailing-slashes/).
Every time a page is created, plugins have the opportunity to handle its [onCreatePage](/docs/reference/config-files/gatsby-node/#onCreatePage) event. This is used for things like creating `SitePage` nodes in [Internal Data Bridge](/docs/internal-data-bridge/).
2 changes: 1 addition & 1 deletion docs/tutorial/authentication-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ exports.onCreatePage = async ({ page, actions }) => {
}
```

> Note: There is a convenient plugin that already does this work for you: [gatsby-plugin-create-client-paths](/plugins/gatsby-plugin-create-client-paths)
> Note: You can also use the [File System Route API](/docs/reference/routing/file-system-route-api/#creating-client-only-routes) to create client-only routes.

Now, you must create a generic page that will have the task to generate the restricted content:

Expand Down