DEV Community 👩‍💻👨‍💻

Discussion on: Building a blog with Svelte: Adding Markdown

jreinhold profile image
Jeppe Reinhold

This is great!
I guess a missing (next) step here, is to render pages/build components based on multiple markdown files in a folder?

chrsjxn profile image
Chris Jackson Author

Mine are currently very simple, and very manual. The page component for this post just looks like this:

  import { Layout, MarkdownPost } from '../Components'
  import markdown from '../Markdown/'

  <MarkdownPost {markdown} />
Enter fullscreen mode Exit fullscreen mode

I am still thinking about a build step that generates these components and their routes based on the structure of my markdown directory. My level of rollup knowledge isn't that high yet, though, so I'm just writing the extra glue by hand right now.