From f51c92b931cf1b3d689334f5e42cc4afc765ff25 Mon Sep 17 00:00:00 2001 From: Ruben Harutyunyan Date: Sun, 9 Jul 2017 02:51:21 +0400 Subject: [PATCH 1/3] Completed path-prefix.md. --- docs/docs/path-prefix.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/path-prefix.md b/docs/docs/path-prefix.md index e38d42e6ef686..7adb3c38c47b7 100644 --- a/docs/docs/path-prefix.md +++ b/docs/docs/path-prefix.md @@ -36,3 +36,11 @@ module.exports = { pathPrefix: `/blog` } ``` + +Then pass `--prefix-paths` cmd option to Gatsby. + +```sh +gatsby build --prefix-paths +``` + +NOTE: When using only `build`, Gatsby ignores `pathPrefix`. From 48c493f9b64b5d327677407a2ae3b44ccea25a24 Mon Sep 17 00:00:00 2001 From: Ruben Harutyunyan Date: Sun, 9 Jul 2017 03:00:27 +0400 Subject: [PATCH 2/3] Adds navigateTo example to gatsby-link docpage. --- packages/gatsby-link/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/gatsby-link/README.md b/packages/gatsby-link/README.md index 55c6f4e0b057f..a98f3be0827af 100644 --- a/packages/gatsby-link/README.md +++ b/packages/gatsby-link/README.md @@ -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" @@ -38,3 +39,17 @@ render () { } ``` + +## Forcing internal redirect + +For cases when you can only use event handlers for navigation, you can use `navigateTo`: + +```jsx +import { navigateTo } from "gatsby-link" + +render () { +
+

Example

+
+} +``` From ac15d9b4dab69c450c69f24ced5a2a8a9711228e Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Sat, 8 Jul 2017 22:29:02 -0700 Subject: [PATCH 3/3] Fixes --- docs/docs/path-prefix.md | 2 +- packages/gatsby-link/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/path-prefix.md b/docs/docs/path-prefix.md index 7adb3c38c47b7..56d0c0855acc8 100644 --- a/docs/docs/path-prefix.md +++ b/docs/docs/path-prefix.md @@ -43,4 +43,4 @@ Then pass `--prefix-paths` cmd option to Gatsby. gatsby build --prefix-paths ``` -NOTE: When using only `build`, Gatsby ignores `pathPrefix`. +NOTE: When running the command without the `--prefix-paths` flag, Gatsby ignores your `pathPrefix`. diff --git a/packages/gatsby-link/README.md b/packages/gatsby-link/README.md index a98f3be0827af..e7aa4f8d10787 100644 --- a/packages/gatsby-link/README.md +++ b/packages/gatsby-link/README.md @@ -40,7 +40,7 @@ render () { } ``` -## Forcing internal redirect +## Programmatic navigation For cases when you can only use event handlers for navigation, you can use `navigateTo`: