Skip to content
Draft
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
28 changes: 28 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check static site
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python3 -m unittest discover -s tests -v
- name: Install browser test tools (not site dependencies)
run: |
python3 -m pip install playwright==1.56.0
python3 -m playwright install --with-deps chromium
- name: Check browser behavior
run: python3 tools/check_browser.py
- uses: actions/upload-artifact@v4
if: always()
with:
name: blog-screenshots
path: preview/blog-*.png
if-no-files-found: ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
node_modules/
.DS_Store
preview/

# Unpublished writing stays local, outside deployed assets.
drafts/
__pycache__/
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Guidance for AI coding agents working in this repository.

## Project overview

Source for [tjwebb.dev](https://tjwebb.dev) — TJ Webb's personal portfolio site. It is a **single self-contained `index.html`** with inline CSS and JS, no build step, no dependencies, and no package manifest (`package.json`, `pyproject.toml`, etc. do not exist).
Source for [tjwebb.dev](https://tjwebb.dev) — TJ Webb's personal portfolio site. It is **self-contained static HTML pages** with inline CSS and JS, no build step, no dependencies, and no package manifest (`package.json`, `pyproject.toml`, etc. do not exist).

The site has a terminal aesthetic and includes:

Expand All @@ -14,7 +14,9 @@ The site has a terminal aesthetic and includes:

## Repository layout

- `public/index.html` — the entire site (markup, styles, scripts all inline).
- `public/index.html` — the portfolio (markup, styles, scripts all inline).
- `public/blog/index.html` and `public/blog/feed.xml` — blog index and RSS feed.
- `tools/blog-post-template.html` and `tools/BLOG.md` — unpublished placeholder template and authoring guide. Never commit unapproved writing to this public repo; keep it in gitignored `drafts/`.
- `public/fonts/` — JetBrains Mono Regular/Bold `.woff2`, self-hosted.
- `public/og-card-v2.png` — social share card (1200x630). **Version the filename when it changes** (e.g. `og-card-v3.png`) and update the `og:image` / `twitter:image` meta tags to match, so cached cards are invalidated.
- `public/projects/` — currently empty.
Expand All @@ -25,19 +27,19 @@ The site has a terminal aesthetic and includes:

## Tech stack and runtime architecture

- Plain HTML/CSS/vanilla JS (ES5-style `var`, no modules, no frameworks). Everything is inlined in `public/index.html`; the only external requests are the two font files.
- Plain HTML/CSS/vanilla JS (ES5-style `var`, no modules, no frameworks). CSS and JS are inlined in each HTML page; the only external requests are the two font files.
- Runtime: Cloudflare Workers **static assets** — there is no Worker script (`wrangler.jsonc` has no `main` entry), so requests are served directly from the asset store.

## Build, test, and deploy

- **No build step and no test suite.** Verification is manual: open `public/index.html` in a browser (or serve `public/` with any static server) and check the themes, the theme toggle, and the cat's behavior — including `prefers-reduced-motion` emulation and narrow viewports.
- **No build step.** Run `python3 -m unittest discover -s tests -v` for static checks (also run in PR CI). Browser verification remains manual: open `public/index.html` in a browser (or serve `public/` with any static server) and check the themes, the theme toggle, and the cat's behavior — including `prefers-reduced-motion` emulation and narrow viewports.
- Local preview with Wrangler: `npx wrangler dev` (serves `public/` per `wrangler.jsonc`).
- Deploy happens by pushing to `main`: GitHub Actions runs `cloudflare/wrangler-action@v3` with `command: deploy`. Manual deploy: `npx wrangler deploy`.
- Wrangler is **pinned to 4.120.1** in the workflow — do not bump blindly; the pin comment notes 4.121.0 depends on an unpublished `miniflare@5.20260804.1-alpha`. Check that this is resolved before upgrading.

## Code style guidelines

- Keep the single-file architecture: new styles go in the existing `<style>` block, new behavior in an existing or clearly-delimited `<script>` block. Do not introduce a bundler, framework, or external CSS/JS files.
- Keep each page self-contained (including article pages): new styles go in the existing `<style>` block, new behavior in an existing or clearly-delimited `<script>` block. Do not introduce a bundler, framework, or external CSS/JS files.
- Match the surrounding idioms: 2-space indent, `var`-based vanilla JS wrapped in IIFEs, CSS custom properties for all theme colors.
- All colors must come from the theme variables (`--bg`, `--fg`, `--green`, etc.) so every palette stays coherent — never hardcode a color in component CSS. When adding a theme, update all three places: the `[data-theme]` CSS block, and the `themes`/`colors` tables in **both** inline scripts (head theme-restoration script and body toggle script).
- Respect accessibility conventions already in place: `aria-hidden` on decorative elements, `aria-label` on the theme toggle, focus-visible styles, and `prefers-reduced-motion` handling for all animation.
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

Source for [tjwebb.dev](https://tjwebb.dev) — TJ Webb's portfolio site.

A single self-contained `index.html` (inline CSS/JS, no build step) with a terminal aesthetic, six switchable color schemes (github-dark, gruvbox, dracula, solarized-dark, monokai, phosphor), and a wandering ASCII cat (left gutter on desktop, free-roam on mobile).
Self-contained static HTML pages (inline CSS/JS, no build step) with a terminal aesthetic, six switchable color schemes (github-dark, gruvbox, dracula, solarized-dark, monokai, phosphor), and a wandering ASCII cat (left gutter on desktop, free-roam on mobile).

## Structure

- `public/index.html` — the site
- `public/index.html` — the portfolio
- `public/blog/index.html` — blog index (empty until the first approved post)
- `public/blog/feed.xml` — RSS feed
- `tools/blog-post-template.html` — placeholder-only article template, not deployed
- `tools/BLOG.md` — draft and publication instructions
- `tests/test_site.py` — dependency-free static checks
- `public/og-card-v2.png` — social share card (version the filename when it changes)
- `tools/og-card.html` — source for regenerating the card via headless Chrome screenshot
- `wrangler.jsonc` — Cloudflare Workers static-assets config with custom domains
Expand All @@ -17,3 +22,9 @@ A single self-contained `index.html` (inline CSS/JS, no build step) with a termi
Push to `main` — GitHub Actions runs `wrangler deploy`. Manually: `wrangler deploy`.

Deployed as a Cloudflare Worker serving static assets, with `tjwebb.dev` and `www.tjwebb.dev` as custom domains.

## Blog and checks

See [the authoring guide](tools/BLOG.md). Keep unapproved writing in local, gitignored `drafts/`, never in this public repository or `public/`. Run `python3 -m unittest discover -s tests -v`; PRs run the same checks without deploying.

PR CI also installs pinned Playwright for browser-only checks (not a production dependency), covering mobile/desktop navigation, theme persistence, keyboard access, reduced-motion mode, JS-disabled content, and the article template. To run locally: `python3 -m pip install playwright==1.56.0`, `python3 -m playwright install chromium`, then `python3 tools/check_browser.py`. Screenshots go to gitignored `preview/`.
10 changes: 10 additions & 0 deletions public/blog/feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>TJ Webb — Blog</title>
<link>https://tjwebb.dev/blog/</link>
<description>Writing by TJ Webb on software engineering, agent harnesses, and developer tools.</description>
<language>en</language>
<atom:link href="https://tjwebb.dev/blog/feed.xml" rel="self" type="application/rss+xml" />
</channel>
</rss>
Loading
Loading