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;
}