Is this planned or somehow already possible?
Its possible via the onCreatePage
page api in a gatsby-node file something like:
exports.onCreatePage = ({ page }) => {
if (page.path.startsWith('/getting-started')) {
page.layout = 'getting-started';
} else if (page.path.startsWith('/components')) {
page.layout = 'components';
}
};
where layout
corresponds to a component file in src/layouts
Yes, that's intended to work... although while doing the RRv4 upgrade, I dropped support for multiple layouts due to the complexity of getting things to work period. I'm finishing a refactor to this part of the code this morning which simplifies things a ton and should make it far easier to support:
Amazing, thanks!
Most helpful comment
Its possible via the
onCreatePage
page api in a gatsby-node file something like:where
layout
corresponds to a component file insrc/layouts