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.

Mango Salsa Chicken

★★★★★

63 reviews · ⏱ 40 min · 👥 3 servings · 🔥 380 kcal ·

Easy

Ingredients

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

Instructions

  1. Season chicken thighs with salt and pepper.
  2. Grill or bake chicken until fully cooked.
  3. In a bowl, combine diced mango, chopped red onion, cilantro, minced jalapeño, and lime juice.
  4. Dice the cooked chicken and mix it with the mango salsa.
  5. Serve over cooked rice.