I'm migrating a project that did some manipulation over the Markdown before rendering.
I want to see if Astro is an option to replace the current system so I tried this:
---
import { getCollection } from 'astro:content';
const posts = await getCollection('blog');
const post = posts[0];
post.body = 'a';
const { Content } = await post.render();
---
<pre>{JSON.stringify(post, null, 2)}</pre>
<Content />
My expectation was that by changing the post body to a then post.render() would render that text. But it's rendering the original string.
Is there any way to modify the markdown before rendering?
Maybe middleware is the way but I'm not sure I understand it, pointing to any reference in the docs would help.