diff --git a/docs/docs/reference/routing/creating-routes.md b/docs/docs/reference/routing/creating-routes.md index d628f9faa937b..ec8adba72cb11 100644 --- a/docs/docs/reference/routing/creating-routes.md +++ b/docs/docs/reference/routing/creating-routes.md @@ -83,6 +83,8 @@ exports.createPages = async function ({ actions, graphql }) { The data for creating these pages doesn't necessarily have to come from Gatsby's internal GraphQL data layer. For example, you can source local files or make async calls to remote APIs. For more information, please see [Creating and Modifying Pages](/docs/creating-and-modifying-pages/). +`path` must not be pre-encoded (ie. using `encodeURI`) however unicode characters are supported. So for a path like `/exámple` pass the string directly. Do not pass `encodeURI('/exámple')` or `/ex%C3%A1mple`. If you receive pre-encoded paths from your CMS you may want to run them through `decodeURI` first to ensure the special characters (eg. `%C3%A1`) are turned back into unicode. + ## Conflicting Routes Since there are multiple ways to create a page, different plugins, themes, or sections of code in your `gatsby-node` file may accidentally create multiple pages that are meant to be accessed by the same path. When this happens, Gatsby will show a warning at build time, but the site will still build successfully. In this situation, the page that was built last will be accessible and any other conflicting pages will not be. Changing any conflicting paths to produce unique URLs should clear up the problem. diff --git a/packages/gatsby/src/redux/actions/public.js b/packages/gatsby/src/redux/actions/public.js index 79feb63e3e470..9089d35a8357b 100644 --- a/packages/gatsby/src/redux/actions/public.js +++ b/packages/gatsby/src/redux/actions/public.js @@ -155,7 +155,7 @@ const reservedFields = [ * Create a page. See [the guide on creating and modifying pages](/docs/creating-and-modifying-pages/) * for detailed documentation about creating pages. * @param {Object} page a page object - * @param {string} page.path Any valid URL. Must start with a forward slash + * @param {string} page.path Any valid URL. Must start with a forward slash. Unicode characters should be passed directly and not encoded (eg. `á` not `%C3%A1`). * @param {string} page.matchPath Path that Reach Router uses to match the page on the client side. * Also see docs on [matchPath](/docs/gatsby-internals-terminology/#matchpath) * @param {string} page.ownerNodeId The id of the node that owns this page. This is used for routing users to previews via the unstable_createNodeManifest public action. Since multiple nodes can be queried on a single page, this allows the user to tell us which node is the main node for the page. Note that the ownerNodeId must be for a node which is queried on this page via a GraphQL query.