Migration of Site Content

2026-03-30

Introduction -

In this post, I’ll walk through how I migrated my portfolio's blog content from GitHub Pages to a fully local Next.js setup. The goal was to simplify my workflow, remove external dependencies, and leverage build-time static content for better performance and reliability.

My Setup -

For this migration, I used:

Why Migrate? -

Previously, my blog content lived on GitHub Pages and was fetched via API calls. While this worked, it had drawbacks:

By moving content locally:

Migration Process -

  1. Create a local content folder - I added /content/posts in the repo. Each blog post gets its own folder with an index.md file for content and optional images.

  2. Move Markdown files -
    Copied existing blog posts from GitHub Pages into /content/posts. Adjusted frontmatter to include title, date, tags, and summary.

  3. Update Next.js content loader - Replaced API fetches with a local retrieveContent() utility using Node’s fs module to read Markdown files at build time.

  4. Update image references - Moved project screenshots and images to /public so they can be referenced locally without relying on GitHub URLs.

  5. Test build - Ran npm run build locally to ensure Next.js parsed all Markdown correctly and generated static pages.

Key Takeaways -