index.js contains the body of the page with the sidebar being one of the component in the tree.UNHANDLED REJECTION Invariant Violation: Path /Users/vaitsund/my-blog/src/layouts/index.js not found in the store pages: {"/Users/vaitsund/my-blog/.cache/dev-404-page.js":{"componentPath":"/User
<snip>
Excerpt from #gatsby channel with @KyleAMathews
ideally layouts could have their own query
but that hasn't been implemented yet
so... yeah, the situation isn't too ideal
Details:
Upvoting for this feature. Layout querying is really helpful when adding global component with data props. eg. a Nav bar component requiring the pathnames from graphql for Linking
Has anyone else looked at this yet? I've spent a bunch of time this week and last trying to figure out how to best take care of this. It really cuts into the guts of Gatsby though so a lot of code to cover. I would greatly appreciate any assistance!
I suspect we will end up taking care of #1255 at the same time.
@jbolda I gave it a shot because I really need it but gave up for the moment. As you said, it's not just a one-line fix to change the search directory.
I started working on dealing with layouts as page components. It... feels kind of... dirty? @KyleAMathews Have you thought about it at all? Wondering if we add another api for createLayout similar to createPage.
https ://github.com/jbolda/gatsby/commit/9fe2b1b84fca1d00697285b7a12d1f9e8de9195a
I can work on it some tonight, and maybe tomorrow and then I need to get back on client work for a while. Looking like I might not get this shipped.
cc @delta98 as he is taking a look at things as well.
Actually had started to talk about this in #553
This was added in #1503.
Appreciate an example of the implementation
@GoChartingAdmin
Most helpful comment
Upvoting for this feature. Layout querying is really helpful when adding global component with data props. eg. a Nav bar component requiring the pathnames from graphql for Linking