Mdx creating pages for all directio #35258
Replies: 2 comments 2 replies
-
Hi! The File System Route API doesn't automatically "map" those things together. If you use There are multiple ways how you can make this work though, with varying levels of difficulty. Here's how you could do it: You give your files a |
Beta Was this translation helpful? Give feedback.
-
Hello, I have the same exact use case. @marketingsolution have you found a workaround? |
Beta Was this translation helpful? Give feedback.
-
Preliminary Checks
Description
I have this page structure:
/blog ->{mdx.slug}.js
/news ->{mdx.slug}.js
/tests -> {mdx.slug}.js
When I write a post for example: honda-test.mdx in /test directory Gatsby is creating pages in with all slugs so I have:
/blog/honda-test
/news/honda-test
/tests/honda-test
Reproduction Link
https://github.com/marketingsolution/MotoTripsPL/tree/youtube-video-schema-component
Steps to Reproduce
1.just add {mdx.slug}.js in few folders in src/pages
2.gatsby develop
3.check if pages are the same for all directories
...
Expected Result
I just need one page for one directory not for all.
Actual Result
the same pages are created for all folders I have in src/pages
Environment
Config Flags
No response
Beta Was this translation helpful? Give feedback.
All reactions