Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/accessibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ jobs:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 12

- uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: .nvmrc
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -40,11 +38,12 @@ jobs:
run: |
npx @axe-core/cli \
http://localhost:4321/ \
http://localhost:4321/about \
http://localhost:4321/work \
http://localhost:4321/articles \
http://localhost:4321/notes \
http://localhost:4321/resume \
http://localhost:4321/about/ \
http://localhost:4321/notes/ \
http://localhost:4321/articles/ \
http://localhost:4321/work/ \
http://localhost:4321/resume/ \
http://localhost:4321/feed.xml \
--exit \
--reporter json \
--save axe-results.json
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Type check

on:
push:
branches: [main]
pull_request:
paths:
- 'src/**'
- 'astro.config.mjs'
- 'tsconfig.json'
- 'package.json'

jobs:
check:
name: astro check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Type check
run: pnpm check
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: semantic-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Release
run: pnpm dlx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branches": "main",
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
# Website
# danmatthew.co.uk

This is my website.
Personal site for Dan Matthew — accessibility and design systems consultant.

Built with [Astro](https://astro.build) and [TinaCMS](https://tina.io), deployed on Netlify.

## Prerequisites

- Node 24 (see `.nvmrc`) — use `nvm use` or `fnm use`
- pnpm 12 — installed automatically via `corepack enable`

## Development

Start the dev server with TinaCMS (CMS sidebar available at `/admin`):

```sh
pnpm dev
```

Or run Astro alone (no CMS):

```sh
pnpm astro dev
```

## Build

```sh
pnpm build # TinaCMS pre-build + Astro build
pnpm build:ci # Astro build only (no TinaCMS, for CI)
pnpm preview # preview the dist/ output locally
```

## Type checking

```sh
pnpm check # runs astro check
```

## Lint & format

```sh
pnpm lint # ESLint (eslint-plugin-astro)
pnpm format # Prettier
```

## Content

Posts live in `src/content/posts/`, articles in `src/content/articles/`, and work case studies in `src/content/work/`. All use Markdown or MDX.

Set `published: false` in frontmatter to keep a post out of the build. TinaCMS reads and writes these files directly.
25 changes: 18 additions & 7 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { defineConfig } from 'astro/config';
import { defineConfig, fontProviders } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';

import mdx from "@astrojs/mdx";

// https://astro.build/config

// https://astro.build/config
export default defineConfig({
site: 'https://danmatthew.co.uk',
integrations: [mdx()]
trailingSlash: 'always',
prefetch: true,
integrations: [
mdx(),
sitemap(),
],
fonts: [
{
provider: fontProviders.bunny(),
name: 'IBM Plex Sans',
cssVariable: '--font-ibm-plex',
weights: [400, 600, 700],
display: 'swap',
},
],
});
10 changes: 10 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import eslintPluginAstro from 'eslint-plugin-astro';
import prettierConfig from 'eslint-config-prettier';

export default [
...eslintPluginAstro.configs.recommended,
prettierConfig,
{
ignores: ['dist/', '.tina/__generated__/', 'node_modules/'],
},
];
30 changes: 13 additions & 17 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@
command = "pnpm build"
publish = "dist"

[[headers]]
for = "/_astro/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"

[[headers]]
for = "/*"
[headers.values]
X-Content-Type-Options = "nosniff"
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
Permissions-Policy = "camera=(), microphone=(), geolocation=()"
Content-Security-Policy = """
default-src 'self' miro.com figma.com *.figma.com;
img-src 'self' res.cloudinary.com images.ctfassets.net;
default-src 'self';
img-src 'self' res.cloudinary.com;
script-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline' fonts.bunny.net;
font-src 'self' fonts.bunny.net"""
style-src 'self' 'unsafe-inline';
font-src 'self';
frame-src miro.com figma.com *.figma.com"""

[[headers]]
for = "/admin*"
Expand All @@ -22,16 +29,5 @@

[[redirects]]
from = "/:year/:month/:date/:slug"
to = "/notes/:slug"
to = "/notes/:year-:month-:date-:slug/"
status = 301

[[plugins]]
package = "@netlify/plugin-sitemap"

[plugins.inputs]
buildDir = "dist"

[[plugins]]
package = "netlify-plugin-hashfiles"


25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,40 @@
"dependencies": {
"@astrojs/mdx": "^8.0.3",
"@astrojs/rss": "^4.0.19",
"@georgedoescode/generative-utils": "^1.0.38",
"@stackblitz/sdk": "^1.11.0",
"@svgdotjs/svg.js": "^3.2.5",
"@timohausmann/quadtree-js": "^1.2.6",
"astro": "^7.3.8",
"eslint": "^9.39.4",
"tinacms": "^3.14.3"
},
"devDependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/sitemap": "^3.2.1",
"@tinacms/cli": "^4.0.1",
"@types/node": "^24.12.2",
"eslint": "^9.39.4",
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-astro": "^1.3.1",
"husky": "^9.1.7",
"lint-staged": "^15.5.2",
"prettier": "^3.8.3"
"prettier": "^3.8.3",
"typescript": "^5.8.3"
},
"browserslist": [
"last 2 versions"
],
"lint-staged": {
"*.js": [
"*.{js,ts,astro}": [
"eslint --fix",
"prettier --write"
]
},
"scripts": {
"dev": "tinacms dev -c \"astro dev\"",
"start": "astro start",
"build": "tinacms build && astro build",
"build:ci": "astro build",
"preview": "astro preview",
"lint": "npm run lint:eslint && npm run lint:prettier",
"lint:eslint": "eslint .",
"lint:prettier": "prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)",
"format": "npm run format:eslint && npm run format:prettier",
"format:eslint": "eslint . --fix",
"format:prettier": "prettier \"**/*.js\" --write",
"test": "playwright test",
"release": "npx standard-version && git push --follow-tags"
"check": "astro check",
"lint": "eslint .",
"format": "prettier --write \"**/*.{js,ts,astro}\""
},
"repository": {
"type": "git",
Expand Down
Loading
Loading