Skip to content

Commit

Permalink
[docs] Document redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
nicknovitski committed Mar 11, 2019
1 parent 60c16a1 commit 569595f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ yarn run export-server

You can find the source of the documentation inside the `pages/versions` directory. Documentation is mostly written in markdown with the help of some React components (for Snack embeds, etc). The routes and navbar are automatically inferred from the directory structure within `versions`.

### Redirects

Server-side redirects are re-created on each run of `deploy.sh`. See that file for

We currently do two client-side redirects, using meta tags with `http-equiv="refresh"`:

- `/` -> `/versions/latest/`
- `/versions` -> `/versions/latest`

This method is not great for accessibility and should be avoided where possible.

### Adding Images and Assets

You can add images and assets to the `static` directory. They'll be served by the production and staging servers at `/static`.
Expand Down
3 changes: 3 additions & 0 deletions docs/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ aws s3 cp \

declare -A redirects # associative array variable

# usage:
# redicts[requests/for/this/path]=are/redirected/to/this/one

# Temporarily create a redirect for a page that Home links to
redirects[versions/latest/introduction/installation.html]=versions/latest/introduction/installation/
# useful link on twitter
Expand Down

0 comments on commit 569595f

Please sign in to comment.