SvelteKit Blog: Add frontmatter data to posts
With mdsvex it was possible to transform my markdown files to html files. Besides the post text, the markdown files contain a frontmatter with pieces of information about the post title and the creation date.
I wanted to access the information in my blog post layout file (link to post) to add this information to the header of the post.
But I didn’t really know how to access the data in the blog-post layout file.
But then I read the mdsvex doc and was surprised.
With mdsvex and svelte props this was super easy because mdsvex passes the frontmatter data to available props in the layout file.