-
I have 2 different filesystem sources and MDX plugin, roughly like this: {
resolve: "gatsby-source-filesystem",
options: {
name: "blog",
path: `${__dirname}/blog`,
},
},
{
resolve: "gatsby-source-filesystem",
options: {
name: "author",
path: `${__dirname}/author`,
},
},
"gatsby-plugin-mdx",
"gatsby-plugin-mdx-source-name", I could probably use the But there doesn't seem to be a way to filter the nodes for the implied query. Is there a way to have the routes I hoped I could use the And as I do not want to have the blog posts nested in a folder, I can't route on |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
After I put some thoughts into it, it feels as if a local transformer, that transforms Mdx-nodes into "author" and "blog" nodes, and perhaps others later on, might be the cleanest solution. Is this indeed a viable solution? I hope I will be able to implement a MVP in the next days, unless someone here has a better idea. |
Beta Was this translation helpful? Give feedback.
Yes, you're on the right path. The File System Route API doesn't allow filtering and as such if you want to split the content, you'll need to create individual interfaces for them.
Here's where the
source
check is happening: https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-jodie-core/gatsby-node.mjs#L127-L130You can take the whole https://github.com/LekoArts/gatsby-themes/blob/main/themes/gatsby-theme-jodie-core/gatsby-node.mjs file as an example on how to achieve what you want