How to use remark-gfm plugin with compileMdx
function
#434
-
I recently migrated from |
Beta Was this translation helpful? Give feedback.
Answered by
sdorra
Dec 22, 2024
Replies: 1 comment 2 replies
-
Hi @suryaashish-tyke, sorry i've missed your post. You can use remark plugins with mdx like that: import { defineCollection, defineConfig } from "@content-collections/core";
import { compileMDX } from "@content-collections/mdx";
import remarkGfm from "remark-gfm";
const posts = defineCollection({
name: "posts",
directory: "content/posts",
include: "*.mdx",
schema: (z) => ({
title: z.string(),
summary: z.string(),
date: z.coerce.date(),
author: z.string(),
}),
transform: async (document, context) => {
const mdx = await compileMDX(context, document, {
remarkPlugins: [remarkGfm]
});
return {
...document,
mdx,
};
},
});
export default defineConfig({
collections: [posts],
}); But i think the |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
suryaashish-tyke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @suryaashish-tyke, sorry i've missed your post. You can use remark plugins with mdx like that: