

If contact.js is moved to a directory called information, located inside src/pages, the page will now be created at /information/contact.

This works at whatever level the file is created at. The browser path is generated from the file path.Īdd this component to src/pages/index.js to create a home page for your site.įor example, src/pages/contact.js creates the page /contact, and src/pages/home.js creates the page /home. ( Plugins can also implement createPages and create pages for you.) By implementing the API createPages in your site’s gatsby-node.js.By using the File System Route API to programmatically create pages from GraphQL and to create client-only routes.By creating React components in src/pages.To handle those pages, you can make use of client-only routes using which is built into Gatsby. This includes routes that need authentication or for dynamic content. Often your application will include routes that are not known at build time. Creating navigation for a Gatsby app requires an understanding of what those paths are and how they’re generated. During the build process, Gatsby creates paths to access pages, handling routing for you. Part of what makes Gatsby sites so fast is that a lot of the work is done at build time and the running site is static content served from a CDN.
