Skip to content

Commit

Permalink
Update docs on creating redirects (#20806)
Browse files Browse the repository at this point in the history
  • Loading branch information
tesseralis authored and gillkyle committed Jan 24, 2020
1 parent 8d521b2 commit 106e74f
Showing 1 changed file with 5 additions and 8 deletions.
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

0 comments on commit 106e74f

Please sign in to comment.