-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send props to index page #3410
Comments
You're supposed to query for data for a page from its component. Have you tried that? createPage is for creating pages from data e.g. markdown files. |
Hmm, I suppose that would make sense. But then, wouldn't Instagram need to provide a graphql API? I think they only do REST. |
@omidahourai obviously Kyle is right about how it is supposed to work (querying data from its component). With that said, we actually did have a scenario where I needed to build the index page via createPages from gatsby-node.js. In case you and anyone else needs to do THAT, simply placing your home component in the /templates directory instead of /pages will solve your problem with the duplicate duplicate /home/ path :) |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates. Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 |
This issue is being closed because there hasn't been any activity for at least 30 days. Feel free to open a new one if you still experience this problem 👍 |
Description
In gatsby-node.js, I am trying to inject data from Instagram to my index page by calling createPage(), but it doesn't seem to work unless I rename the index.js to home.js and have it create it from home.js with path of
/
. This works but now I have a duplicate/home/
path that I don't want to exist. Tried calling deletePage() on the home path but it throws errors so maybe I'm doing it wrong? I tried to delete it inexports.createPages
, and also inexports.onPostBootstrap
.Environment
Gatsby version: ^1.9.147
Node.js version: 8.9.3
Operating System: OSX 10.13.2
File contents (if changed):
gatsby-node.js
:The text was updated successfully, but these errors were encountered: