Back to Blog
Tutorials
Featured

Building a Modern Blog Feature with Next.js, MDX, and AI-Assisted Development

Martín Marlatto

Martín Marlatto

CSO at WillDom | Partner

December 27, 20253 min
nextjs
mdx
ai-development
claude
blog
Building a Modern Blog Feature with Next.js, MDX, and AI-Assisted Development

Building a blog from scratch can feel like a daunting task—routing, content management, styling, SEO, and more. But with the right tools and an AI-assisted workflow, you can ship a production-ready blog feature in hours, not weeks. Here's how we did it.

The Stack

Our blog is built on a modern, performant foundation:

  • Next.js 15 with App Router for server-side rendering and static generation
  • MDX for rich content with embedded React components
  • Tailwind CSS for styling with a dark theme
  • TypeScript for type safety throughout
  • Claude Code as an AI pair programmer

Architecture Decisions

File-Based Content with MDX

We chose MDX over a headless CMS for several reasons:

  1. Version Control: Blog posts live in the repository, tracked by git
  2. Developer Experience: Authors can use familiar markdown syntax with React components
  3. Performance: Static generation at build time means fast page loads
  4. Flexibility: Custom components like <Badge> can be embedded directly in content

Dynamic Imports for MDX Components

One interesting challenge was rendering MDX content in Next.js 15. We solved it using dynamic imports:

const mdxComponents: Record<string, React.ComponentType> = {
  'my-blog-post': dynamic(() => import('@/content/blog/my-blog-post.mdx')),
  // ... more posts
}

This approach gives us:

  • Code splitting: Each post is loaded only when needed
  • Type safety: TypeScript knows about our component map
  • Simple routing: The slug maps directly to the component

Custom MDX Components

We created styled components that match our dark theme:

export function useMDXComponents(components: MDXComponents): MDXComponents {
  return {
    h2: ({ children }) => (
      <h2 className="text-3xl font-bold text-white mt-12 mb-4 border-b border-neutral-800 pb-2">
        {children}
      </h2>
    ),
    p: ({ children }) => (
      <p className="text-neutral-200 text-lg leading-8 mb-6">
        {children}
      </p>
    ),
    // ... more components
  }
}

The AI-Assisted Workflow

What made this project unique was the development process. Using Claude Code as a pair programmer, we:

  1. Planned the architecture together, discussing trade-offs
  2. Implemented features with Claude writing code while I reviewed
  3. Fixed bugs by sharing error messages and iterating quickly
  4. Added content by pasting raw text that Claude formatted into proper MDX

What Worked Well

  • Rapid iteration: Changes that might take 30 minutes manually took seconds
  • Consistency: Claude maintained code style across all files
  • Error handling: When builds failed, Claude could read logs and fix issues
  • Content formatting: Raw LinkedIn posts were transformed into well-structured MDX with proper headings, blockquotes, and badges

Lessons Learned

  • Be specific: Clear instructions yield better results
  • Review everything: AI assistance doesn't replace human judgment
  • Iterate quickly: Don't try to get everything perfect in one prompt
  • Trust but verify: Always test the generated code

Features Implemented

The final blog includes:

  • Blog listing page with category filtering and search
  • Individual post pages with rich MDX content
  • Related posts based on category matching
  • SEO optimization with meta tags and JSON-LD structured data
  • Responsive design that works on all devices
  • RSS feed for subscribers
  • Reading time estimation for each post

Conclusion

Building with AI assistance isn't about replacing developers—it's about amplifying what we can accomplish. In a single session, we went from zero to a fully-featured blog with 9 published posts, proper styling, and production-ready code.

The future of software development is collaborative: humans providing direction, creativity, and judgment, while AI handles the repetitive work and accelerates implementation.

What will you build with AI assistance?

Next.js
MDX
AI Development