Closed Neobii closed 3 years ago
Yeah good question. I definitely buy the /docs/nest
in this specific scenario, because this is how pages works in Next.js (whatever the page extension is, so including .md, .mdx or whatever).
I wonder how Next handles conflicting names like /docs/nest.md
and /docs/nest/index.md
, never tried it yet. But we could simply fail in this specific scenario with an error message.
I have the nested documents working on this branch.
Do you think this functionality still belongs in vulcan-npm
and not in vulcan-next
?
Initially it was in vulcan-next
indeed. I wanted something easy to remove though to unbloat the starter, as we may want to add more features to @vulcan/mdx
in the future.
The code sounds good, do not hesitate to PR so I can review (preferably with a few unit tests if you have some spare time, using a mock for readdir, but I can handle that)
Aha, I was afraid of bloating the monorepo! I think the finding files recursively and dealing with index
type things might be in a lib folder rather than the mdx
type stuff.
However, we could put this in the mdx mdx first tag regex
It's better to bloat the monorepo than the starter imo, because you are not forced to install all packages through NPM, only the ones you use, so it's a safe place for adding whatever we want. The Starter has to be streamlined as much as possible (it's already bloated with styling stuff...).
In order to make ListMdxFiles recursive, we should decide how we handle the
index.md
files, or if we handle them.For example,
/docs/nest/index.md
should resolve to/docs/nest
instead of/docs/nest/index
.This was the object planned... if I'm correct.