No description
  • Astro 77.3%
  • CSS 20.2%
  • JavaScript 2.5%
Find a file
2026-05-18 17:20:22 +01:00
.vscode first commit 2026-05-18 17:20:22 +01:00
public first commit 2026-05-18 17:20:22 +01:00
src first commit 2026-05-18 17:20:22 +01:00
.gitignore first commit 2026-05-18 17:20:22 +01:00
astro.config.mjs first commit 2026-05-18 17:20:22 +01:00
package-lock.json first commit 2026-05-18 17:20:22 +01:00
package.json first commit 2026-05-18 17:20:22 +01:00
README.md first commit 2026-05-18 17:20:22 +01:00
tsconfig.json first commit 2026-05-18 17:20:22 +01:00

alexchadwick.com

Personal brand site built with Astro. Static output, served by Caddy on Ubuntu 24.04.

Local development

npm install
npm run dev        # dev server at http://localhost:4321
npm run build      # production build to dist/
npm run preview    # preview the dist/ output locally

Project structure

src/
  layouts/
    Base.astro       # HTML shell, meta tags, global CSS import
  pages/
    index.astro      # Single page — all sections live here
  styles/
    global.css       # Design tokens, resets, base styles
public/
  favicon.svg
  favicon.ico
dist/                # Build output (git-ignored)

To add a new page (e.g. /blog), create src/pages/blog/index.astro and import Base.astro. No routing config needed.

Deploying to the VPS (manual SSH)

First-time setup

On the server, create the web root and configure Caddy:

sudo mkdir -p /var/www/alexchadwick.com
sudo chown $USER:$USER /var/www/alexchadwick.com

Add a block to /etc/caddy/Caddyfile:

alexchadwick.com {
    root * /var/www/alexchadwick.com
    file_server
    encode gzip

    # Clean URLs — serve /about as /about.html if it exists
    try_files {path} {path}.html {path}/index.html
}

Reload Caddy:

sudo systemctl reload caddy

Deploying an update

Build locally, then sync the output to the server:

npm run build
rsync -avz --delete dist/ user@your-server:/var/www/alexchadwick.com/

Replace user@your-server with your actual SSH host (or alias from ~/.ssh/config).

The --delete flag removes files on the server that no longer exist locally. Run without it first if you want to preview the diff:

rsync -avzn --delete dist/ user@your-server:/var/www/alexchadwick.com/

Optional: deploy script

Create deploy.sh in the project root:

#!/usr/bin/env bash
set -euo pipefail
npm run build
rsync -avz --delete dist/ user@your-server:/var/www/alexchadwick.com/
echo "Deployed."
chmod +x deploy.sh
./deploy.sh