frouo / next-markdown

Markdown Pages for Next.js with 0 effort, dynamic routes and your layout design
https://twitter.com/nextmarkdown
117 stars 5 forks source link

feat (advanced): allow to flatten some directories for docs / blog classification purpose #15

Closed frouo closed 2 years ago

frouo commented 2 years ago

Purpose

In some circumstances, you likely want to use subfolders to classify your markdown files. For example when writing docs.

So you want a way to bypass the default next-markdown dynamic routes.

Considered solution

✋ default dynamic routes MUST remain because it covers 99% of use cases. We all love how nextjs works with /pages. . Eg: path/to/projects.md will match /path/to/project.

We could have a .nextmd.config.json file at the root of a given folder to bypass how next-markdown will consider this folder's subfolders.

# .nextmd.config.json

{
  "flatten": ["examples", "features"]
}

image

Discussion

Tell me what you think in comment. Thanks