Skip to content

Commit

Permalink
Move users page to sections
Browse files Browse the repository at this point in the history
We want to create the users "page" via a `createPage` call so that we can use it /users/:username URLs. When this was located within the `/pages` directory gatsby automatically created a page at `/users` which loaded fine, but the `createPage` functionality was lost (i.e. /users/userName wouldn't load). By moving this file gatsby no longer automatically creates a URL for it and we get back our desired behaviour via `createPage`.
  • Loading branch information
jameshadfield committed Jan 15, 2020
1 parent bbbd3b9 commit 431b191
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static-site/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ exports.createPages = ({graphql, actions}) => {
createPage({
path: "/users",
matchPath: "/users/*",
component: path.resolve("src/pages/users.jsx")
component: path.resolve("src/sections/users.jsx")
});
})
);
Expand Down
File renamed without changes.

0 comments on commit 431b191

Please sign in to comment.