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

Update docs on creating redirects #20806

Merged
merged 1 commit into from
Jan 24, 2020
Merged
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
13 changes: 5 additions & 8 deletions docs/contributing/docs-contributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,11 @@ Sometimes it makes sense to move or rename a file as part of docs restructuring

- Run proposed structure changes by the Gatsby docs team in [a GitHub issue](/contributing/how-to-file-an-issue/) to ensure your change is accepted.
- Update all instances of the old URL to your new one. [Find and replace](https://code.visualstudio.com/docs/editor/codebasics#_search-across-files) in VS Code can help. Check that the context of the original link reference still makes sense with the new one.
- For SEO purposes, add a redirect to the `createPages` function in [`www/gatsby-node.js`](https://github.com/gatsbyjs/gatsby/tree/master/www/gatsby-node.js). Here's an example:

```js:title=www/gatsby-node.js
createRedirect({
fromPath: `/docs/source-plugin-tutorial/`,
toPath: `/docs/pixabay-source-plugin-tutorial/`,
isPermanent: true,
})
- For SEO purposes, add a redirect to [`www/redirects.yaml`](https://github.com/gatsbyjs/gatsby/tree/master/www/redirects.yaml). Here's an example:

```yaml:title=www/redirects.yaml
- fromPath: /docs/source-plugin-tutorial/
toPath: /docs/pixabay-source-plugin-tutorial/
```

## Claim your swag
Expand Down