Welcome to the source code for my personal site! Take a look around, see how things work and maybe even run it yourself if you feel like it. Just don't pretend to be me. That would be weird.
You will need Node.js installed, along with npm
, and they should match the version range given in the engines
field in package.json
.
# install dependencies
npm install
# run the app
npm start
# build the site for production
npm run build
# run linters all at once
npm run lint
# or run linters individually
npm run lint:css
npm run lint:js
npm run lint:html
# update any outdated npm dependencies
npm run update-deps
To optimize images, paste a batch of jpg
images into a folder at the root called pictures-of-cats
. Then run any of these scripts to optimize them.
# do everything in one go
npm run optimize-images
# only optimize in jpg format
npm run images:jpg
# only optimize in webp format
npm run images:webp
# only optimize in avif format
npm run images:avif
# remove all jpg images from the `pictures-of-cats` folder
npm run images:clean
To run Playwright tests locally, you will need to create a .env
file. Use .env.example
as a starting point for filling in the variables you need. BASE_URL
should point to where the site is running, typically http://localhost:8080
, but you can point it at the production site or a deploy preview for some manual testing.
# run Playwright tests
npm run test:e2e