Skip to content

andrewginns/andrewginns.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Andrew Ginns - Personal Website ✨

Welcome! This is the source code for my personal website, andrew.ginns.uk. If you've arrived here from my site, hello!

This repository showcases how a modern, minimalist personal website can be built with Astro for optimum performance and a fantastic developer experience. It's designed to be a living digital CV, project showcase, and a space for technical writing.

🌐 Live Demo

Check out the live website at: andrew.ginns.uk

✨ Key Features

  • Blazing Fast Performance: Built with Astro for a lightweight, super-fast static site.
  • Dynamic Content: Automatically syncs profile information and projects from my GitHub profile.
  • Minimalist Design: Clean, text-centric, and responsive, focusing on content and readability.
  • Blog Ready: Easily manage blog posts using local Markdown files.
  • Developer Friendly: Uses TypeScript, Prettier, ESLint, and Husky for a smooth development workflow.
  • Dual Deployment: Continuously deployed to both GitHub Pages and Cloudflare Pages.

Tech Stack

  • Framework: Astro - Static site generator with excellent performance
  • Language: TypeScript
  • Styling: Vanilla CSS with CSS custom properties
  • Deployment: GitHub Pages & Cloudflare Pages
  • CI/CD: GitHub Actions

πŸ“‚ Project Structure

/
β”œβ”€β”€ .env.example          # Example environment variables
β”œβ”€β”€ .github/              # GitHub Actions workflows
β”‚   └── workflows/
β”‚       β”œβ”€β”€ deploy.yml       # Main deployment to GitHub Pages & Cloudflare
β”‚       β”œβ”€β”€ dev-deploy.yml   # Deployment for development branches
β”‚       └── update-badge.yml # Workflow to update status badges
β”œβ”€β”€ .husky/               # Git hooks for pre-commit checks
β”‚   └── pre-commit
β”œβ”€β”€ .vscode/              # VSCode editor settings
β”‚   β”œβ”€β”€ extensions.json
β”‚   β”œβ”€β”€ launch.json
β”‚   └── settings.json
β”œβ”€β”€ public/               # Static assets (images, favicon, etc.)
β”‚   β”œβ”€β”€ andrew-headshot.jpeg
β”‚   └── favicon.svg
β”œβ”€β”€ scripts/              # Utility and automation scripts
β”‚   β”œβ”€β”€ capture-*.ts       # Various screenshot capture scripts
β”‚   β”œβ”€β”€ test-*.ts          # Scripts for specific test scenarios
β”‚   β”œβ”€β”€ package.json       # Scripts-specific package config
β”‚   └── tsconfig.json      # TypeScript config for scripts
β”œβ”€β”€ src/                  # Main source code
β”‚   β”œβ”€β”€ components/       # Reusable Astro components (UI building blocks)
β”‚   β”‚   β”œβ”€β”€ Footer.astro
β”‚   β”‚   β”œβ”€β”€ HeroCard.astro
β”‚   β”‚   β”œβ”€β”€ LastUpdated.astro
β”‚   β”‚   β”œβ”€β”€ LoadingSpinner.astro
β”‚   β”‚   β”œβ”€β”€ OptimisedImage.astro
β”‚   β”‚   β”œβ”€β”€ ProjectCard.astro
β”‚   β”‚   └── SkeletonCard.astro
β”‚   β”œβ”€β”€ content/          # Markdown content collections
β”‚   β”‚   └── writing/      # Blog posts
β”‚   β”‚       └── .gitkeep  # Placeholder, add your .md files here
β”‚   β”œβ”€β”€ layouts/          # Page layouts (structure for pages)
β”‚   β”‚   └── BaseLayout.astro
β”‚   β”œβ”€β”€ lib/              # Core library functions
β”‚   β”‚   β”œβ”€β”€ content.ts    # Content fetching and processing
β”‚   β”‚   └── github.ts     # GitHub API integration logic
β”‚   β”œβ”€β”€ pages/            # Astro pages (website routes)
β”‚   β”‚   β”œβ”€β”€ index.astro   # Homepage
β”‚   β”‚   β”œβ”€β”€ ...           # Other site pages
β”‚   β”‚   └── contact_me.astro
β”‚   β”œβ”€β”€ utils/            # Helper utilities
β”‚   β”‚   β”œβ”€β”€ globalData.ts # Global data and constants
β”‚   β”‚   └── tagAggregator.ts # Logic for aggregating tags
β”‚   └── content.config.ts # Astro content collection schemas
β”œβ”€β”€ tests/                # Playwright end-to-end tests
β”‚   β”œβ”€β”€ *.spec.ts         # Test specifications for various features
β”œβ”€β”€ .gitignore            # Files and folders ignored by Git
β”œβ”€β”€ .lintstagedrc.json    # Lint-staged config for pre-commit checks
β”œβ”€β”€ .prettierignore       # Files ignored by Prettier formatter
β”œβ”€β”€ .prettierrc.json      # Prettier code formatting rules
β”œβ”€β”€ Makefile              # Common development commands
β”œβ”€β”€ README.md             # You are here!
β”œβ”€β”€ astro.config.mjs      # Astro framework configuration
β”œβ”€β”€ compare-screenshots.ts # Script for visual regression testing
β”œβ”€β”€ eslint.config.ts      # ESLint linting rules
β”œβ”€β”€ mobile-improvements-summary.ts # Script for mobile improvements
β”œβ”€β”€ package-lock.json     # Exact dependency versions
β”œβ”€β”€ package.json          # Project metadata and dependencies
β”œβ”€β”€ playwright.config.ts  # Playwright test runner configuration
└── tsconfig.json         # TypeScript compiler options

Local Development

Prerequisites

  • Node.js 18.20.8+ or 20.3.0+
  • npm 9.6.5+

Setup

# Clone the repository
git clone https://github.com/andrewginns/andrewginns.github.io.git
cd andrewginns.github.io

# Install dependencies
npm install

# Start development server
npm run dev

The site will be available at http://localhost:4321

Available Commands

Command Action
npm run dev Start development server
npm run build Build production site
npm run preview Preview production build locally
npm run lint Lint code using ESLint
npm run format Format code using Prettier
npm run validate Run type checking, linting, and formatting checks
astro check TypeScript type checking

Content Management

Dynamic GitHub Integration

The website automatically pulls content from GitHub to minimise maintenance:

Profile Information

  • Company: Automatically fetched from your GitHub profile company field
  • Role/Title: Extracted from your GitHub bio using pattern matching
  • Unified caching: Single API call per build for optimal performance
  • Fallback values: Graceful degradation if GitHub API is unavailable

Projects

  • Automatic sync: Projects are pulled from your GitHub pinned repositories
  • No manual updates needed: Pin/unpin repos on GitHub to update the website
  • Fallback content: Static projects display if GitHub API is unavailable

Blog Posts (Optional)

You can manage blog posts in two ways:

  1. Local Markdown Files (current setup):
    • Create .md files in src/content/writing/
    • Add frontmatter:
    ---
    title: "Your Post Title"
    description: "Brief description"
    date: 2024-01-18
    tags: ["machine-learning", "mlops"]
    ---

GitHub API Configuration

The website uses a unified caching mechanism for all GitHub API calls to optimise performance:

Core Functions

  • getCachedGitHubProfile() - Fetches profile, company, and role information
  • getCachedGitHubData() - Fetches repository and project data
  • getCachedGitHubGists() - Fetches blog post content from gists

For better API rate limits and access to GraphQL (pinned repos):

  1. Create a GitHub Personal Access Token with public_repo scope
  2. Add to .env file:
    GITHUB_TOKEN=your_token_here
    
  3. The build process will use this token when fetching data

Note: The site works without a token but may hit rate limits or not show pinned repos. All GitHub API calls include graceful error handling with fallback values.

Deployment

The site automatically deploys to both GitHub Pages and Cloudflare Pages:

Automatic Triggers

  • On push: Deploys when code is pushed to main branch
  • Daily rebuild: Runs at 00:00 UTC to fetch latest GitHub data
  • Manual trigger: Can be triggered manually from GitHub Actions tab

Preview Deployments

  • On Pull Request: When a Pull Request is opened targeting the main branch (or when new commits are pushed to such a PR), a preview deployment is automatically made to GitHub Pages.
  • A comment containing a link to this preview deployment is added to the Pull Request, allowing for easy review of changes.

Environment Variables in CI/CD

The GitHub Actions workflow automatically provides:

  • GITHUB_TOKEN: Automatically available in Actions for API access. This is used for fetching data from your GitHub profile and repositories during the build process.
  • No additional manual token configuration is needed for the core deployment functionality.

GitHub Pages Setup

  1. Enable GitHub Pages in repository settings
  2. Set source to "GitHub Actions"
  3. The site will be available at https://andrewginns.github.io

Cloudflare Pages Setup

  1. Add the following secrets to your GitHub repository:
    • CLOUDFLARE_API_TOKEN
    • CLOUDFLARE_ACCOUNT_ID
  2. The workflow will automatically deploy to Cloudflare Pages

Custom Domain

To use the custom domain andrew.ginns.uk:

  1. Configure DNS to point to GitHub Pages or Cloudflare Pages
  2. Add custom domain in GitHub Pages settings
  3. Update site in astro.config.mjs

Design Philosophy

The website follows a minimalist, content-first approach:

  • Clean typography with system fonts
  • Ample whitespace for readability
  • Fixed sidebar navigation (responsive on mobile)
  • Subtle colour palette with high contrast
  • No unnecessary visual elements
  • Focus on content and user experience

Contributing

While this is a personal website, suggestions and bug reports are welcome. Please open an issue for discussion.

πŸ™ A Special Thanks

A big thanks to Google Jules and Claude Code for doing the heavy lifting. Couldn't have done it without you, your tireless contributions, bug-hunting prowess, and unconstrained MCP tool use. Cheers, digital comrades! πŸ€–

License

This project is licensed under the MIT License. Content (blog posts, project descriptions) remains copyright of Andrew Ginns.

πŸ’¬ Get in Touch

I'm always open to connecting with fellow developers, data enthusiasts, and potential collaborators!

Thanks for visiting!

About

Personal Website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •