Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gatsbyjs/gatsby
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jul 9, 2017
2 parents 30a8b2b + 0ac5342 commit 672b8fe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/docs/path-prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@ module.exports = {
pathPrefix: `/blog`
}
```

Then pass `--prefix-paths` cmd option to Gatsby.

```sh
gatsby build --prefix-paths
```

NOTE: When running the command without the `--prefix-paths` flag, Gatsby ignores your `pathPrefix`.
15 changes: 15 additions & 0 deletions packages/gatsby-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Edge), this component will also preload code chunks on these browsers.
## How to use

In javascript:

```jsx
import Link from "gatsby-link"

Expand All @@ -38,3 +39,17 @@ render () {
</div>
}
```

## Programmatic navigation

For cases when you can only use event handlers for navigation, you can use `navigateTo`:

```jsx
import { navigateTo } from "gatsby-link"

render () {
<div onClick={navigateTo('/example')}>
<p>Example</p>
</div>
}
```

0 comments on commit 672b8fe

Please sign in to comment.