Open shinokada opened 2 years ago
It is still working. All you have to do is make the folder (something like hello-world) and create +page.md(or svx, whatever extension you want for mdx) then start writing markdown like before.
If you're using mdsvex for a blog, and don't want individual folders for each blogs you can create a slug, and have a +page.svelte
to serve the markdown.
Here's an article on it: https://joshcollinsworth.com/blog/build-static-sveltekit-markdown-blog#approach-2-dynamic-routes
I'm currently looking into a simple solution for kit + mdsvex atm after the new routing changes. Im not happy with how much boilerplate is required.
MDsveX is cool!
And how to use it in Astro ? [svelte + md + island] 👻
If you're using mdsvex for a blog, and don't want individual folders for each blogs you can create a slug, and have a
+page.svelte
to serve the markdown. Here's an article on it: https://joshcollinsworth.com/blog/build-static-sveltekit-markdown-blog#approach-2-dynamic-routes
This was really a great tutorial illustrating various approaches to using MDsveX and SvelteKit, after the big router changes. Consider adding this as a recommended resource in the README.md
?
@pngwn
Please pin this issue so other users can find it easily.
I have src/routes/+layout-toc.svelte
and I extend it in src/routes/layouts/component/+page@toc.svelte
.
And adding this to `mdsvex.config.js:
...
const config = defineConfig({
layout: {
componentLayout: './src/routes/layouts/component/+page@toc.svelte',
...
In a md file, I try to use it:
---
layout: componentLayout
...
---
But it uses the default +layout.svelte
.
How can I use an extended layout?
Any updates on this? Would love the pre processor to automatically turn myblog.md
into myblog/+page.svelte
if that's possible and was what you were thinking when talking about ditching boilerplate.
Its very difficult unfortunately, svelte kit doesn't allow you to hook into the router in anyway, and it is only interested in folders. As mdsvex is just a preprocessor, it needs the build system to actually find the file in order to do anything.
Solving this problem will require a complex integration, or something built on top of kit.
While reading https://github.com/sveltejs/kit/discussions/5774, I wondered if I have to update or change for mdsvex.