Skip to main content
Reggie Pangilinan
HomeBlogAbout
GitHubLinkedIn

© 2026 reggiepangilinan.com All rights reserved.

GitHubLinkedIn
How I Built My Personal Website (and Why I Only Pay for…
←Back to Blog

How I Built My Personal Website (and Why I Only Pay for the Domain)

Under the hood of reggiepangilinan.com: Next.js 16 hybrid rendering, Contentful workflows, CSS Modules, and keeping everything comfortably on free tiers.

December 2, 2026·Reggie Pangilinan·6 min read
How I Built My Personal Website (and Why I Only Pay for the Domain)

Most personal websites start with good intentions and end up as either a half-finished template or an over-engineered side project you're afraid to touch six months later. 😅

I wanted reggiepangilinan.com to land somewhere practical in the middle: fast to load, easy to write on, cheap to run, and clean enough that I wouldn't dread coming back to it after a busy quarter. Right now, the whole site runs on Next.js 16 (App Router), React 19, TypeScript, CSS Modules, Contentful, and Netlify.

Because both Contentful and Netlify have generous free tiers, the only thing I actually pay for is the domain name. Keeping it that way—without sacrificing speed or publishing convenience—is what shaped most of the architecture.


🔀 1. Mixing Three Rendering Modes (Instead of Picking Just One)

Early on, I tried treating the whole site with a single rendering strategy, and it quickly got annoying.

Pure static generation (SSG) is super fast, but needing a full rebuild just to fix a typo in a blog post gets old fast. On the flip side, aggressively revalidating every page every few minutes burns through serverless function invocations and Contentful API calls for no good reason—especially on a personal blog where posts don't change every five minutes.

So I split the site into three rendering modes, matched to how often each page actually changes:

  • Static (SSG) for / and /about: These pages only change when I push code, so they're pre-rendered at build time and served straight from Netlify's CDN. Zero runtime CMS calls.

  • Dynamic (force-dynamic) for /blog: When I hit publish in Contentful, I want the new post to show up on the blog index immediately—not hours later. Since a personal blog index doesn't get millions of hits a day, keeping /blog dynamic is well within free-tier limits and makes publishing feel instant.

  • 24-Hour ISR + Webhooks for /blog/[slug]: Individual posts are read far more often than they're edited. Each post caches for 24 hours (revalidate = 86400) and generates new slugs on demand (dynamicParams = true). When I do edit a post, a Contentful webhook calls POST /api/revalidate to clear that specific post, the /blog list, and the sitemaps right away.

  • 6-Hour ISR for /sitemap-isr.xml: Search engines don't need real-time sitemaps, so caching it for 6 hours keeps CMS calls minimal.

Hybrid Rendering Strategy — reggiepangilinan.com
Hybrid Rendering Strategy — reggiepangilinan.com

Avoiding Duplicate CMS Calls with React cache()

One small gotcha with Next.js App Router: on a blog post route, both generateMetadata() (for SEO tags) and the page component need the same post from Contentful. If you just call your CMS helper in both places, you double your API requests on every cache miss.

Wrapping the slug lookup (fetchBlogPostBySlug in src/lib/contentful.ts) in React's cache() solves that cleanly—both calls share a single Contentful request per render.


🚀 2. From Publish to Reader (Without a Full Rebuild)

Contentful is great for managing posts, and pairing it with webhooks and its built-in Image API keeps publishing lightweight.

When I publish or edit a post in Contentful, a webhook hits POST /api/revalidate. That endpoint validates the slug and clears the cached post, the /blog index, and the sitemaps—so readers get the updated page immediately without waiting for a full Netlify build.

From Publish to Reader (No Full Rebuild)
From Publish to Reader (No Full Rebuild)

Letting Contentful's Image API Do the Heavy Lifting

For blog images hosted on images.ctfassets.net, src/lib/contentful-image-optimizer.ts appends Contentful's Image API query parameters (w, h, q, fm=webp|avif, fit) directly to the URL so images come back resized and compressed in modern formats.

It also handles Open Graph social cards automatically: when a post has a featured image, the metadata builder requests a 1200×630 center-cropped progressive JPEG so sharing a link on LinkedIn, X, or Slack looks clean without me manually exporting social thumbnails in Figma.


🎨 3. Keeping the Frontend Simple & Clean

A few frontend choices on this site are deliberately straightforward—and that's been a huge win for maintainability:

  • CSS Modules + CSS Variables: Every color, font size, and spacing token lives in src/app/globals.css, and every reusable component sits in its own folder (Component.tsx, Component.module.css, index.tsx). Plain CSS Modules keep a minimalist black-and-white site super readable with zero styling lock-in.

  • Dark-First Without the White Flash: Dark mode is the default, and html:not([data-theme]) { visibility: hidden } prevents that brief flash of the wrong theme before the saved preference loads.

  • Built-In Sharing + QR Codes: Every blog post has a PostShareBar with one-click link copy, native mobile share support, and a client-side QR code generator (with PNG download) in case I ever want to drop a link to a post onto a slide deck or share it in person.

  • Security Headers & Clean URLs in src/proxy.ts: Next.js 16's proxy.ts normalizes accidental double slashes in URLs with a 301 redirect and sets a strict Content-Security-Policy plus standard security headers across the site.

  • Word-Boundary SEO Truncation: src/lib/seo.ts trims page titles (60 chars) and meta/social descriptions (155 / 125 chars) cleanly at word boundaries so previews don't cut off awkwardly mid-word.


🛡️ 4. Guardrails That Save Me From Myself

The real test of a personal repo isn't week one—it's coming back six months later (or pairing with an AI coding agent) and not accidentally breaking things. A few lightweight guardrails in the repo have paid off way more than expected:

  • One Config File, Enforced Automatically: Domain, email, author name, and social links all live in src/config/site.ts. A custom npm run guards script scans the codebase in pre-commit hooks and GitHub Actions CI to catch hardcoded personal values and broken documentation links.

  • Zero-Secret Builds: If Contentful environment variables aren't set locally or in CI, src/lib/contentful.ts falls back gracefully to returning empty results instead of crashing. That means anyone cloning the repo—and GitHub Actions on every PR—can run lint, type-check, guards, and build without needing CMS credentials.

  • An AGENTS.md File for AI-Assisted Maintenance: Since I use coding agents to help maintain and upgrade the site, keeping a short AGENTS.md at the root with the rendering rules, folder conventions, and required checks keeps both AI tools and future-me aligned.


🔧 5. The Rough Edges (What Still Bugs Me)

To be completely honest, it's not all spotless:

  • Next.js Static Literal revalidate Exports: Next.js requires export const revalidate = 86400 in page files to be a literal number—you can't just import it from a config file. Right now I keep a centralized src/config/isr.ts and validate against it, which works, but it's still two places to update if I ever change the timing.

  • Docs Still Drift: Even with an automated link checker, architecture diagrams can fall behind after major framework upgrades (like moving from Next.js 15 to 16). Catching that still takes manual discipline.

  • Light on Automated Tests: Static checks (lint, type-check, guards, build) catch a lot, but I still want to add lightweight unit tests for the URL utilities, SEO truncation, and Contentful fallback logic.


✨ Wrapping Up

You really don't need paid infrastructure to run a fast, well-structured personal site. Matching each route's rendering mode to how often it changes, leaning on Contentful's Image API and webhooks, and adding a few simple repo guardrails lets the whole thing run comfortably on free tiers—leaving the domain name as the only bill.

If you want to poke around the code, the repo is public on GitHub at github.com/reggiepangilinan/mywebsite.

Keep Reading

Related Posts

December 3, 2026

Adding AI-Powered Blog Search with Google Gemini in Next.js

How we added an intelligent, Gemini-powered search bar to a Next.js + Contentful blog—covering AI basics for non-specialists, why hybrid search beat Google Search Grounding and Vertex AI Search, real-world free-tier traffic estimates, and built-in cost guardrails.

Next.jsTypeScript
December 3, 2026

Running a Full Next.js Blog on Free Tiers: A Contentful + Netlify Case Study

A data-backed case study breaking down Contentful Free, Netlify Free, and GitHub Free quotas (at the time of this writing), with real math on how many visitors, blog posts, and images a personal site can serve before ever paying a cent for infrastructure.

Next.jsContentful
December 2, 2026

Four Silent Sitemap & SEO Bugs I Found Auditing My Next.js 16 Blog

What sitemaps, robots.txt, and canonical URLs actually do for search indexing—plus four silent SEO bugs I found and fixed auditing my Next.js 16 + Contentful blog.

Next.jsSEO
Topics
Next.jsSoftware ArchitectureTypeScriptContentfulNetlify

Share this article

Found this helpful? Copy the link or scan the QR code to share it.

←All blog posts