Portfolio Website
2 min read
This portfolio website is a personal space designed to display my projects, share experiments, and publish technical articles. The goal was to build a clean, blazing-fast, and visually appealing developer portfolio that lets the work and content stand out.

🛠️ Tech Stack
- Framework: Next.js (App Router & Static Generation)
- Styling: Tailwind CSS v4 & Vanilla CSS variables
- Content Engine: Custom MDX parser with LaTeX and syntax highlighting support
- Hosting: Vercel with integrated speed insights
📖 The MDX Content Engine
The heart of the website is a highly customized MDX parsing and rendering engine designed to parse .mdx files into interactive HTML pages on-the-fly.
🔌 Custom Markdown Processor (MarkdownRenderer)
The renderer combines ReactMarkdown with a customized pipeline of remark and rehype plugins:
- Math Equations: Integrated
remark-mathandrehype-katexto natively parse and format LaTeX blocks (display equations and inline math formulas) using KaTeX style sheets. - Syntax Highlighting: Powered by
rehype-highlightwith automatic programming language detection. - Copy-to-Clipboard: Code blocks are wrapped in a custom
PreWithCopycomponent that renders a copy button showing visual feedback states. - Anchor Headings: Headers (
h2,h3,h4) are automatically slugified to generate unique IDs, adding a hoverable#anchor link for easy section sharing. - Secure Links: Auto-detects external links to append
target="_blank"andrel="noopener noreferrer".
📊 Lazy-Loaded Mermaid Diagrams
- Renders flowcharts and diagrams using Mermaid.js.
- To keep the initial page load lightweight, the
Mermaidcomponent is loaded using dynamic client-side imports (next/dynamicwithssr: false). - The component dynamically queries the resolved theme from
next-themesto render light or dark layouts matching the site theme.
🧭 Scroll Utilities
- Visual Table of Contents: A sidebar navigation that tracks headings dynamically. It uses an
IntersectionObserveralongside scroll event fallback mechanisms to highlight the current active heading. It renders a clean dashboard visual where section lines dynamically expand and reveal their titles on hover. - Scroll Progress Indicator: An optimized scroll depth indicator mounted to
document.bodyusing a React Portal. It animates a high-contrast top-screen bar as the user scrolls down the page.