this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add MDX support to post pages

+11 -9
+1 -7
posts/test.mdx
··· 2 2 title: Test Post 3 3 --- 4 4 5 - import Balloon from "@components/blog/balloon.svelte"; 6 - 7 5 whats this about dawg 8 6 9 - <div style="padding: 15rem;"></div> 10 - 11 - <div style="position: absolute"> 12 - <Balloon client:load id={0} boundingWidth={300} boundingHeight={0} /> 13 - </div> 7 + (Vi a vis .MDX)
+10 -2
src/pages/blog/[id].astro
··· 10 10 if (!post) return r404; 11 11 12 12 const { 13 - data: { title }, 13 + data: { title, hasMdx }, 14 14 } = post; 15 - const { Content } = await render(post); 15 + 16 + const Content = await (async () => { 17 + if (!hasMdx) return render(post).then((x) => x.Content); 18 + 19 + if (!post.filePath) throw new Error("Post does not have a filepath"); 20 + return import(`../../content/posts/${parse(post.filePath).name}.mdx`).then( 21 + (x) => x.Content 22 + ); 23 + })(); 16 24 --- 17 25 18 26 <Base title={title}>