Back to projects
NextJs MDX Portfolio.

NextJs MDX Portfolio.

Kavindu Rashmika / May 12, 2025

This is a portfolio website built with NextJs and MDX. It uses the @next/mdx package to render MDX content in NextJs pages.

โœจ Features

  • MDX Support ๐Ÿ“: Write content in MDX format.
  • Syntax Highlighting ๐Ÿ–๏ธ : Code blocks are syntax highlighted.
  • Custom Components ๐Ÿ—ƒ๏ธ: Use custom components in your MDX files.
  • Responsive Design ๐Ÿ“ฒ: The website is responsive and works on all devices.
  • Light & Dark Mode ๐ŸŒ—: The website supports dark mode.
  • SEO Optimized ๐Ÿ”: The website is optimized for search engines.
  • Contact + Newsletter ๐Ÿ“ง: A contact form to get in touch and a newsletter form to subscribe.
  • Image Optimization ๐Ÿ–ผ๏ธ: Images are optimized for faster loading.

๐Ÿงฐ Tech Stack

  • Next.js โš›๏ธ: A React framework for building static and dynamic websites.
  • MDX โœ๏ธ: A file format that allows you to write JSX in your Markdown files.
  • TailwindCSS ๐ŸŽจ: A utility-first CSS framework for building custom designs.
  • Vercelโœ…: A cloud platform for static sites and serverless functions.
  • Resend ๐Ÿ“ง: A service for sending emails and SMS.
  • Shadcn/ui ๐Ÿงฉ: Customizable and accessible React UI components built on Radix UI and TailwindCSS.

๐Ÿง  Challenges & Solutions

  • MDX + React: Embedding React components caused hydration mismatches initially. Using dynamic imports and isolating interactive parts fixed this.
  • Theme Toggle: Ensuring smooth, flicker-free theme switching was tricky, but Tailwindโ€™s utilities and state persistence made it manageable.
  • Image Optimization: Managing images for different screen sizes was challenging. Using Next.js's built-in image component solved this, ensuring responsive images without manual adjustments.
  • SEO: Ensuring SEO best practices with MDX was tricky. Using Next.js's Head component and structured data helped improve SEO.

๐Ÿ”ฎ Whatโ€™s Next?

  • ๐Ÿ“Š Integrate advanced analytics to track engagement
  • ๐Ÿ”ง Add more custom MDX components and shortcodes
  • ๐Ÿ’ป Include interactive portfolio demos and live code examples
  • ๐Ÿ“ง Enhance the newsletter feature with segmentation and analytics

๐Ÿš€ Deployment and platforms

  • Vercel โ–ฒ
  • Cloudflare โ˜๏ธ
  • Namecheap ๐ŸŒ
  • Resend โœ‰๏ธ
  • ImprovMX ๐Ÿ“ฌ

โœ… Final Thoughts

  • This portfolio is a reflection of my growth and creativity as a developer. Using Next.js, MDX, TailwindCSS, and Resend, Iโ€™ve built a site thatโ€™s scalable, maintainable, and a joy to work on.

  • I hope you found this project interesting and informative. If you have any questions or feedback, feel free to reach out to me.Thanks for reading!