lkmail.me

lkmail Update 1.14: Building the MDX Parsing Architecture

Welcome to Update 1.14 of the lkmail development journey!

With our foundational layouts locked in and external links centralized, it is time to tackle the most important feature of this digital identity: the blog. [cite_start]To maximize E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness) for SEO, content needs to be fast, accessible, and deeply integrated into the application[cite: 254, 255].

Today, we laid the groundwork for our MDX parsing architecture.

The KISS Approach to Content

The modern web development ecosystem is obsessed with Headless CMS platforms. While powerful, connecting a third-party database to a personal portfolio introduces network latency, API key management, and unnecessary complexity.

[cite_start]Adhering strictly to the KISS (Keep It Simple, Stupid) principle [cite: 255][cite_start], I decided that lkmail will have absolutely no heavy headless CMS[cite: 257, 258].

[cite_start]Instead, all blog posts will live directly inside the repository under the src/content/blog/ directory as pure .mdx files[cite: 258].

The Tech Stack: Local File Parsing

[cite_start]To make this work seamlessly within the Next.js 16 App Router, we integrated two critical packages[cite: 255, 256]:

  1. gray-matter: This utility is responsible for reading the raw markdown files and parsing the YAML "frontmatter" at the top of the file (which contains metadata like the title, date, and tags).
  2. [cite_start]next-mdx-remote: This library takes the parsed markdown body and securely compiles it into native React components on the server[cite: 271, 272].

Why This Matters

By keeping the content local:

[cite_start]With the architectural strategy defined, the next step is to write the pure TypeScript utility (src/lib/mdx.ts) that will physically read these files and feed them to our React pages[cite: 264, 265].

Phase 2 is heating up!