Write content with Markdown and MDX

MDX allows you to use JSX directly within your Markdown content. You write the text in Markdown, which is quicker than HTML for headings, lists or emphasis, and import JSX components wherever you need dynamic content.

How do I configure MDX for Jeasx? If you want to use MDX with Jeasx, simply run npm install @mdx-js/esbuild and add the configuration below to ESBUILD_SERVER_OPTIONS in jeasx.config.js. Visit jeasx.dev/jsx to learn how to enhance MDX with additional plugins.

export default {
  // The server imports this config at startup too, so import build-only plugins lazily.
  /** @type {() => Promise<import("esbuild").BuildOptions>} */
  ESBUILD_SERVER_OPTIONS: async () => {
    const { default: mdx } = await import("@mdx-js/esbuild");
    return {
      plugins: [
        mdx({
          development: process.env.NODE_ENV === "development",
          jsxImportSource: "jsx-async-runtime",
          elementAttributeNameCase: "html",
          stylePropertyNameCase: "css",
        }),
      ],
    };
  },
};

The MDX cookbook

These recipes are loaded from an API while the page is rendered. Pick one: the link sets ?recipe=, which MDX reads via props.request.query, just like in any other JSX route.

Chicken Alfredo Pasta

★★★★★

82 reviews · ⏱ 35 min · 👥 4 servings · 🔥 500 kcal ·

Medium

Ingredients

Tick them off while you shop; plain checkboxes and CSS, no JavaScript needed.

Instructions

  1. Cook fettuccine pasta according to package instructions.
  2. In a pan, sauté sliced chicken in butter until fully cooked.
  3. Add minced garlic and cook until fragrant.
  4. Pour in heavy cream and grated Parmesan cheese. Stir until the cheese is melted.
  5. Season with salt and pepper to taste.
  6. Combine the Alfredo sauce with cooked pasta.
  7. Garnish with fresh parsley before serving.