A static academic website built with Astro + Svelte and Tailwind CSS.
You’re welcome to re-use this for your own site, but (i) some of the scripts are built around my own file organization; (ii) much of this was written with the codex and claude cli tools; and (iii) it’s still work in progress.
- Node.js 22 or higher
- pnpm 11.25.0 (pinned in
package.json; enable it with Corepack)
Clone this repository and install dependencies:
git clone <your-fork-url>
cd <project-directory>
corepack enable
corepack install
pnpm install
pnpm --dir scripts installThere are scripts to automate getting markdown of my publications
which you probably cannot use (see the section on scripts below).
Remove these node ./scripts/get-md-for-writing.mjs && from the build script in package.json.
It should look like this:
{
...
"scripts": {
"dev": "astro dev",
"build": "node ./scripts/generate-llms.mjs && astro build",
...
}
...
}If you understand what you are doing, you should be able to point the codex CLI or claude code at this README and ask it to do the rest of the setup for you.
Essential replacements (search and replace these throughout the codebase):
-
Name and Identity:
- Replace
Stephen A. ButterfillandStephen Butterfillwith your name - Replace
Butterfillin navigation (seesrc/layouts/BaseLayout.astroline 79)
- Replace
-
Email Address:
- Update
s.butterfill@warwick.ac.ukinsrc/components/EmailModal.svelte(line 6)
- Update
-
Site Title and Description:
- Update page titles in
src/pages/index.astro(line 48) - Update the hero section description (lines 61-63)
- Update the personal bio section (lines 257-277)
- Update page titles in
-
Footer:
- Update copyright in
src/layouts/BaseLayout.astro(line 108)
- Update copyright in
Remove existing content and add yours:
# Remove all existing content
rm -rf src/content/writing/*
rm -rf src/content/talks/*
rm -rf src/content/teaching/*
rm -rf public/md/*Add your content:
- Publications: Create
.mdfiles insrc/content/writing/(see Content Management section below) - Talks: Create
.mdfiles insrc/content/talks/ - Teaching: Create
.mdfiles insrc/content/teaching/
Start the development server:
pnpm devVisit http://localhost:4321 to see your site.
Run the test suite:
pnpm testFor a single test run without watching for changes:
ppnpm test:unitThe playwright tests are not meaningful guarantees of anything (I always start with good intentions but can never quite figure out how to maintain them).
Commands:
# One-time: install the Playwright browser
pnpm e2e:install
# Run smoke tests (starts `pnpm dev` automatically on :4321)
ppnpm test:e2e:dev
# Optional interactive UI runner
pnpm e2e:openNotes:
- Tests target
http://localhost:4321(Astro default). If you change the dev port, updateplaywright.config.ts. - The smoke suite fails on console errors, failed requests, or 4xx/5xx responses. If there are known benign warnings you want to ignore, add an allowlist in
tests/smoke.spec.ts.
pnpm build # Builds the site and generates llms.txt
pnpm preview # Preview the built site locally/
├── public/ # Static assets
│ ├── pdf/ # Academic papers and talk handouts
│ ├── img/talks/ # Slide images organized by talk
│ └── _redirects # Cloudflare redirect rules
├── src/
│ ├── content/ # Content collections
│ │ ├── writing/ # Academic publications
│ │ ├── talks/ # Conference talks (organized by year)
│ │ └── teaching/ # Course materials
│ ├── components/ # Reusable UI components
│ ├── layouts/ # Page layouts
│ └── pages/ # Site pages and routing
├── scripts/ # Content management scripts
│ ├── generate-llms.mjs # Generates the LLM bundle (text + metadata + content)
│ ├── sync-bibtex.mjs # Syncs content from BibTeX files
│ ├── import-talks.mjs # Imports talks from external repository
│ └── bib-filter.js # Filters BibTeX entries by author
└── docs-developers/ # Developer documentation
The scripts/ directory contains tools for importing and managing academic content.
These are related to my own file organization and workflow, so unlikely to be useful.
You can create the entries in writing manually, but if you already have them as bibtex then this script will import them for you:
cd scripts
node sync-bibtex.mjs path/to/your/bibliography.bibThis script:
- Parses BibTeX entries
- Creates markdown files in
src/content/writing/ - Extracts metadata (title, authors, year, journal, etc.)
*You don't need to use this directly as it’s called by sync-bibtex.mjs.
Filters BibTeX files by author name:
cd scripts
node bib-filter.js input.bib --keyword "your-name" > filtered.bibOptions:
--keyword, -k: Author name to filter by (default: "butterfill")- Automatically excludes conference abstracts and thesis entries
- Filters out entries with "submitted", "progress", or "preparation" in year field
Automatically imports talks from a separate talks repository (will not work for you as it depends on the way I organize my files):
node scripts/import-talks.mjs --helpThis script detects new or updated talks from your talks repository and creates corresponding content files. See --help for all options including dry-run mode.
This creates files for LLMs crawling the site (you want them to train on your work).
Builds the complete LLM bundle (text index, metadata, and long-form markdown files):
node scripts/generate-llms.mjsOutputs land in public/llms.txt and public/llms/ (metadata, index, and per-item content).
- Manual approach: Create markdown files in
src/content/writing/ - BibTeX approach: Use
sync-bibtex.mjsto import from bibliography files
-
Add the full text as html in
<div class="fulltext"></div>in thearticle.mdfile. -
Add markdown to
public/md. Make sure the md has the same basename as the article. The build script will find the markdown file.
Where a markdown file exists, Copy for Chat (with LLMs) will be enabled. [∞todo: also add shortcuts in the LLM bundle metadata]
Add the pdf to public/pdf and update the pdfUrl property [∞todo: auto match pdfs to filenames]. Make sure the pdf has the same basename as the article.
- Create markdown files in
src/content/talks/YYYY/(organized by year) - Add slide images to
public/img/talks/talk-name/ - Include
slideImagesarray in frontmatter for interactive presentations
Create markdown files in src/content/teaching/ for course materials and lectures.
I only do it this way for some ancient talks with slides as images. (If you do not have that problem, use Reveal.js directly or put slides and handouts on a separate site.) Talks can include interactive slide presentations using Reveal.js:
---
title: "My Talk"
slideImages:
- /img/talks/my-talk/slide-000.jpg
- /img/talks/my-talk/slide-001.jpg
---pnpm buildThis command:
- Runs
generate-llms.mjsto refresh the LLM bundle - Builds the static site to
./dist/
pnpm previewPreview the built site locally before deployment.
I currently use Cloudflare Pages with manual deploy. (Have used s3 in the past; also use surge.sh for testing.)
-
Set up Cloudflare Pages (one-time setup)
pnpm dlx wrangler login pnpm dlx wrangler pages project create <project name, e.g. 'www-butterfill-new' for me>
-
Build the site:
pnpm build
-
Deploy to Cloudflare Pages:
pnpm dlx wrangler pages deploy dist
The site includes redirect rules in public/_redirects for maintaining backward compatibility with old URL structures. These are automatically handled by Cloudflare Pages.
You probably do not want these as they’re specific to my old site.
Additional docs cover specific features and were mostly auto generated.
docs-developers/- about fulltext, command pallet, llms.txt, etcdocs-developers/hashme-q3-hard-mode.md- q3 hashme hard-mode implementation detailsspecs/- design specs for some of the features
MIT (do whatever you want with it)