How to convert dynamic data to MDX
See original GitHub issueHello, I got data on GraphCMS in markdown text and I’d like to convert it to MDX. Could you tell me how to do it? I’ve installed mdx-bundler.
content: portfolioItem.portfolios[0].content, // <--- it containts the markdown text from GraphCMS.
I tried with mdx-remote but there were errors with severity vulnerabilities
I got
import { bundleMDX } from "mdx-bundler";
export const getStaticProps = async ({ params }) => {
const portfolioItem = await getPortfolioItem(params.slug);
return {
props: {
portfolioItem: portfolioItem.portfolios[0],
content: portfolioItem.portfolios[0].content,
},
};
};
export default function Home({ portfolioItem, content }) {
console.log(portfolioItem);
return (
<div className="prose prose-xl max-w-none mt-4 text-justify dark:text-gray-100 mb-10">
{content}
</div>
);
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:14
Top Results From Across the Web
Create a dynamic set - IBM
Procedure · Create a book. · Navigate to the SData database, SalesCube cube, and expand Views. · Click the model dimension tile, and...
Read more >Converting Calc Formulas to MDX, Hyperion Essbase outlines ...
The storage characteristics of a member and hence all its associated cells are defined in a block storage outline through dynamic calc (and...
Read more >How to Source MDX Content in Next.js to Dynamically Create ...
To learn how to add MDX to a project, we're going first source a few MDX files, using blog posts as an example,...
Read more >Analysis Services MDX Query Designer (Power Pivot)
Open the Power Pivot window. · Click Home > Get External Data > From Database > From Analysis Services or Power Pivot. ·...
Read more >Part 5: Transform Data to Use MDX - Gatsby
Under allMdx , open the nodes dropdown. Inside the frontmatter dropdown, you should see fields for all the keys you created in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, everything works right now 👍 appreciate your help 😄 btw. is it possible to highlight the syntax in js? there is just gray color of the text 😦
Looks like mdx-bundler is doing its job 😃
Is tailwind-typography installed and configured?