My first portfolio was a Vite + React single-page app. It looked fine in the browser, but the HTML that search engines received was just this:
<div id="root"></div>
Everything else (my name, experience, projects) was rendered by JavaScript after the page loaded. Google can execute JavaScript, but it does it later and less reliably, and most link previews (LinkedIn, Facebook, Zalo) don't run it at all.
What changed
- Server-rendered HTML. Every page is rendered on the server with Next.js App Router, so crawlers and link previews get real content on the first request.
- Metadata per page. Title, description, canonical URL and Open Graph image are defined with the
metadataAPI instead of one hard-coded block inindex.html. - Structured data. A
PersonandWebSiteJSON-LD block tells search engines who I am, where I work and which profiles belong to me. Blog posts shipBlogPostingdata. - One URL per project. Projects used to live only inside a modal. Now each one also has its own page under
/projects, so it can be indexed and shared. - Sitemap and robots. Generated from the same data that renders the site, so they never go stale.
Keeping the fun parts
SEO doesn't have to mean a boring site. The 3D keyboard, GSAP animations and smooth scrolling are still here; they are loaded on the client after the important text is already in the HTML.
The design is based on the open-source 3d-portfolio by Naresh Khatri (MIT).