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.

Quinoa Salad with Avocado

★★★★☆

59 reviews · ⏱ 35 min · 👥 4 servings · 🔥 280 kcal ·

Easy

Ingredients

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

Instructions

  1. In a large bowl, combine cooked quinoa, diced avocado, halved cherry tomatoes, diced cucumber, diced red bell pepper, and crumbled feta cheese.
  2. Drizzle with lemon vinaigrette dressing and toss to combine.
  3. Season with salt and pepper to taste.
  4. Chill in the refrigerator before serving.