Skip to content

Instantly share code, notes, and snippets.

@brunosabot
Created February 27, 2022 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunosabot/5dcd2b0374bb7445b1248d3ec0fdad78 to your computer and use it in GitHub Desktop.
Save brunosabot/5dcd2b0374bb7445b1248d3ec0fdad78 to your computer and use it in GitHub Desktop.
import { serialize } from "next-mdx-remote/serialize";
import gist from "./lib/gist";
async function transformGreyMatterToMDX(post) {
const mdxSource = await serialize(post.content, {
mdxOptions: {
remarkPlugins: [gist],
rehypePlugins: [],
},
scope: post.data,
});
return mdxSource;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment