Building a site with JSX and MDX plugins #398
-
|
Hello, First of all thanks all who helped build Lume, I'm enjoying getting to try out Deno b\y building a static site using Lume. Coming from Next.js I was trying to set up my Lume site using the JSX and MDX plugins but I'm currently stuck in rendering a collection of posts in JSX. I've tried to look though the docs, examples, and framework code, but I haven't come a cross a way to do I can get the posts content to render with: export default ({ title, children, search }, { date }) => (
{search.pages("post").map((post, index) => (
<div>
{post.data.content}
</div>
)}
))But it renders the raw MDX content, not HTML. Can anyone help or have any ideas? I've also tried to use Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hi. But Due this is a recurrent issue, I will find a way to integrate this behavior natively on Lume. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for the quick reply @oscarotero! I look forward to the change, and again, thanks for creating and sharing Lume. 🙂 |
Beta Was this translation helpful? Give feedback.
Hi.
Indeed,
post.data.contentcontains the raw file content of the page. The rendered content is stored inpost.content.But
post.contentnot only contains the MDX code rendered but also the layout used to wrap this code. There's similar issue at #357 regarding to how to access to the rendered content before being merged with the layout, and the only current way is by creating a "proxy" layout to store the content.Due this is a recurrent issue, I will find a way to integrate this behavior natively on Lume.