broccolini.github.com icon indicating copy to clipboard operation
broccolini.github.com copied to clipboard

Migrate personal website from Gatsby.js to Astro

Open Copilot opened this issue 7 months ago • 0 comments

This PR completes the migration of Diana Mounter's personal website from Gatsby.js to Astro, modernizing the tech stack while preserving all existing functionality and content.

Overview

The migration transforms the site from a Gatsby.js React application to an Astro static site with React islands, improving build performance and simplifying the architecture while maintaining the existing design and user experience.

Key Changes

Framework Migration

  • From: Gatsby.js v2 with GraphQL and multiple plugins
  • To: Astro v5 with React integration and MDX support
  • Benefits: Faster builds, simpler configuration, better performance

Content Management

  • Migrated from Gatsby's file-based routing to Astro content collections
  • Converted 18 musings posts and 11 reading posts from page-based MDX to content collections
  • Added proper frontmatter titles to all blog posts for better organization

Styling Architecture

  • Replaced styled-components + styled-system with CSS custom properties
  • Maintained existing design system using CSS variables for colors, spacing, and typography
  • Simplified component styling while preserving responsive behavior

Component Migration

  • Converted complex React components to simpler implementations
  • Maintained component-based architecture for reusability
  • Used React islands for interactive content while keeping most content static

Build & Development

  • Updated scripts: gatsby developastro dev, gatsby buildastro build
  • Changed output directory from /public to /dist
  • Simplified deployment process with maintained GitHub Pages compatibility

Technical Details

New File Structure

src/
├── layouts/Layout.astro          # Main layout component
├── pages/                        # Astro pages
│   ├── index.astro              # Homepage with React island
│   ├── about.astro              # About page
│   ├── musings/                 # Blog section
│   └── reading/                 # Reading section
├── content/                      # Content collections
│   ├── musings/                 # Blog posts as MDX
│   └── reading/                 # Reading posts as MDX
├── components/                   # React components
└── styles/global.css            # CSS custom properties theme

Performance Improvements

  • Static site generation for all pages
  • Reduced JavaScript bundle size through selective hydration
  • Optimized asset handling with Astro's built-in optimizations

How to Run

Development

npm install
npm run dev
# Site available at http://localhost:4321

Production Build

npm run build
npm run preview  # Preview built site

Deploy

npm run deploy  # Builds and deploys to GitHub Pages

Testing

All existing functionality has been tested and verified:

  • ✅ Homepage with all sections (Work, Talks, Writing, Side Projects, Interviews)
  • ✅ About page
  • ✅ Musings blog section with individual posts
  • ✅ Reading section with individual posts
  • ✅ Navigation between all pages
  • ✅ Static assets and images
  • ✅ Responsive design
  • ✅ Clean build process with no errors

The migration maintains 100% feature parity while providing a more modern, maintainable, and performant foundation for the website.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/withastro/astro/tarball/examples/minimal
    • Triggering command: node /home/REDACTED/.npm/_npx/abdb4b598af046c4/node_modules/.bin/create-astro . --template minimal --typescript --git --install (http block)
  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/broccolini.github.com/broccolini.github.com/node_modules/.bin/astro build (dns block)
    • Triggering command: node /home/REDACTED/work/broccolini.github.com/broccolini.github.com/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Jul 28 '25 18:07 Copilot