`layout` option of `createPage` does not work
See original GitHub issueDescription
layout
option of createPage
does not work. As this document https://www.gatsbyjs.org/docs/creating-and-modifying-pages/#creating-pages-in-gatsby-nodejs, layout
option can be passed to createPage
API so Gatsby can get a template from layouts/${layout}
folder.
Environment
Gatsby version: 1.9.138 Node.js version: v8.9.3 Operating System: Mac OS High Sierra 10.13.2
Actual result
If layout
option is passed an value to createPages
API, ex: ‘blog-layout’, layouts/blog-layout.js
is not loaded. So I have to ignore the layout
- don’t pass any value, in order to Gatsby falls to default value to load layouts/index.js
file.
Expected behavior
layout
option should work like in the document (https://www.gatsbyjs.org/docs/creating-and-modifying-pages/#creating-pages-in-gatsby-nodejs) mentions.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Creating and Modifying Pages - Gatsby
Gatsby makes it easy to programmatically control your pages. Pages can be created in three ways: By creating React components in the src/pages...
Read more >Gatsby Query createPage context options from page template
Pass context to pages. When in doubt, check the docs. import React from 'react' import { graphql } from 'gatsby' const Page =...
Read more >Create and use page templates in Pages on Mac
In Pages on your Mac, create page templates for page layout documents. ... Changes you make in your document don't affect the page...
Read more >Create Page Layouts - Salesforce Help
With the enhanced page layout editor, you can tailor record page layouts to the needs of your users. Add, remove, or reorder actions,...
Read more >Page Setup - Microsoft Support
Use the Page Setup dialog box to set up layout and print options of a page. Click on the Page Layout tab, then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also having this issue as well, using
exports.createPages
like thisStill uses the
index
layout.But when I apply layout from
exports.onCreatePage
it works.Due to the high volume of issues, we’re closing out older ones without recent activity. Please open a new issue if you need help!