Search code examples
markdownsveltesapper

Sapper/Svelte: How do I add markdown files?


I am creating a blog using Sapper using the default sapper-template-rollup.

In the blog folder, it does mention about generating data from markdown files. But I can't find how to do it?


Solution

  • Update 2020-06-14:

    There is a GitHub version as well now (since 2019-11-11) that publishes with Netlify and has a custom domain added. So unlike the GitLab version, it does not use Sapper's base URL to alter the base path that is necessary with GitLab and GitHub pages unless you add a custom domain.

    Original answer 2019-10-24:

    You may find this repo helpful. I also have an open PR on the Sapper Template repo, first revising the old Markdown branch in Jan. 2019 and then adding Svelte 3 support in May 2019, but it is probably easier to look at and clone my repo on GitLab, plus it has more current dependency updates I have not added to the PR yet.