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.
Check out the live website at: andrew.ginns.uk
- 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.
- 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
/
βββ .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
- Node.js 18.20.8+ or 20.3.0+
- npm 9.6.5+
# 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
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 |
The website automatically pulls content from GitHub to minimise maintenance:
- 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
- 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
You can manage blog posts in two ways:
- Local Markdown Files (current setup):
- Create
.md
files insrc/content/writing/
- Add frontmatter:
--- title: "Your Post Title" description: "Brief description" date: 2024-01-18 tags: ["machine-learning", "mlops"] ---
- Create
The website uses a unified caching mechanism for all GitHub API calls to optimise performance:
getCachedGitHubProfile()
- Fetches profile, company, and role informationgetCachedGitHubData()
- Fetches repository and project datagetCachedGitHubGists()
- Fetches blog post content from gists
For better API rate limits and access to GraphQL (pinned repos):
- Create a GitHub Personal Access Token with
public_repo
scope - Add to
.env
file:GITHUB_TOKEN=your_token_here
- 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.
The site automatically deploys to both GitHub Pages and Cloudflare Pages:
- 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
- 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.
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.
- Enable GitHub Pages in repository settings
- Set source to "GitHub Actions"
- The site will be available at
https://andrewginns.github.io
- Add the following secrets to your GitHub repository:
CLOUDFLARE_API_TOKEN
CLOUDFLARE_ACCOUNT_ID
- The workflow will automatically deploy to Cloudflare Pages
To use the custom domain andrew.ginns.uk
:
- Configure DNS to point to GitHub Pages or Cloudflare Pages
- Add custom domain in GitHub Pages settings
- Update
site
inastro.config.mjs
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
While this is a personal website, suggestions and bug reports are welcome. Please open an issue for discussion.
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! π€
This project is licensed under the MIT License. Content (blog posts, project descriptions) remains copyright of Andrew Ginns.
I'm always open to connecting with fellow developers, data enthusiasts, and potential collaborators!
- LinkedIn: linkedin.com/in/andrewginns
- GitHub: You're already here! Feel free to open an issue or explore my other projects.
Thanks for visiting!