leerob / nextjs-prism-markdown

Example using Prism / Markdown with Next.js including switching syntax highlighting themes.
https://nextjs-prism.vercel.app
102 stars 42 forks source link

Is there a way to get a list of all docs (.md files)? #4

Open ekfuhrmann opened 2 years ago

ekfuhrmann commented 2 years ago

This is a great boilerplate, but I am struggling to figure out how to extract all of the markdown files into a list that contains the link and document names, think something along the lines of a sidebar.

Any suggestions?

prabincankod commented 2 years ago

this might work.

const posts = readdirSync("posts").map((postName) => postName.replace(".md", "") );