Skip to main content

Using MDX for Static Content in Next.js

Blog · 2025-01-10 · 1 min read

How we use gray-matter and next-mdx-remote for the db.fyi content layer.

  • nextjs
  • mdx
  • content

db.fyi uses local MDX files for all tool and resource content. No CMS and no database for phase one.

Stack

  • gray-matter for frontmatter parsing.
  • next-mdx-remote for rendering MDX body on the server.
  • fs in getStaticProps / server components to read from src/content/ai and src/content/resources.

Schema

Each tool MDX has required frontmatter: name, tagline, category, pricing, stars, featured, url, description. Optional: features, toolType, image. Content quality: no filler; explain what the tool does.

Security

We only load MDX from src/content. No runtime fetch of remote MDX. No eval or user-generated MDX.

Author

Vineet Talwar

Tech Consultant, Fractional CTO, Public Speaker, Climate-tech enthusiast