Skip to content

Clean up the site: lighter first load, simpler checks - #2

Merged
bkowshik merged 9 commits into
mainfrom
site-cleanup
Nov 6, 2026
Merged

bkowshik merged 9 commits into
mainfrom
site-cleanup

Conversation

@bkowshik

@bkowshik bkowshik commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

A cleanup round before new work: less tooling, a lighter first load, and one test gap closed. Each change is its own commit, so they can be reviewed one at a time.

What changed

Fixes

  • Test and deploy site/ directly. The tests served a copy in _site that only npm run check refreshed, so npm test could pass on stale files: with the stylesheet link broken, it still passed 24 of 24. On a fresh clone it waited 60 seconds and then failed. The published files now live in site/, which removes collect-site.sh, the collect script and _site.
  • Correct the Node requirement. engines said >=22.13, but html-validate 11 needs ^22.22.0 || >=24.8.0.

Performance

  • Cut the fonts down to English text and drop hinting. The pages use 43 characters, and the fonts carried 202 plus hinting. Together they go from 27.2 KB to 9.9 KB.
  • Write the signal path in relative coordinates. The same 401 points, in 1.4 KB less of index.html.

Removals and duplication

  • Remove .nojekyll. Actions deployments never read it, and it wasn't being published.
  • Drop fontkit. It brought in 11 of 29 packages for one test, which now uses a character range.
  • Upload the Pages artifact only on push. PR runs never deploy it.
  • Load the logo from favicon.svg instead of keeping three copies. The dark colors move into the SVG, so the favicon gets a dark version too.
  • Tidy the stylesheet. One hover rule for all links, one color-scheme, and one breakpoint fewer.

Results

Measure Before After
First load 34.0 KB 16.2 KB
First paint, slow 4G phone 476 ms 420 ms
Fonts ready, slow 4G phone 486 ms 404 ms
npm packages 29 18

Load times are medians of 9 cold loads on a throttled local server, so the comparison matters more than the exact numbers. A fast desktop connection shows no meaningful change.

How it was checked

  • npm run check passes all 24 tests on Node 22.23, and npm test works from a clean export of the branch with no other step.
  • Deliberately breaking the stylesheet link, adding an accented letter, removing the logo and changing the palette without re-rendering are each caught.
  • Compared with main in Chrome on macOS, 44 of 52 size, theme and page combinations are pixel-identical. The other 8 are the 641px and 699px screens on both pages, which is the intended spacing change below.
  • Both fonts match the test's character range and the README command exactly, and keep their copyright and license text.

What to look at

  • Windows text rendering is untested. macOS ignores hinting, but Windows uses it, so text may look slightly softer on low-resolution monitors. This is the one change that could look worse to some visitors.
  • Accented letters now fall back to a system font. The test fails if one appears, and the README says how to add it. The range in the test is a copy of the one in the README's command, so the two have to change together.
  • Screens from 641 to 699px get the phone spacing. That covers side, intro and card padding.
  • The 404 page's links now change color on hover. This is the only hover change.
  • /LICENSE is no longer published on the site. No page linked to it, and it stays in the repository.
  • og.png differs in 10 of 756,000 pixels, from rounding on the edge of the signal line.
  • The page weight budget is unchanged at 50 KB. The page is now about 22 KB uncompressed, so the budget could come down.

After merging

  • Delete the old _site folder from any existing checkout. It's no longer ignored, so it will show up as untracked.
  • Local preview now needs --directory site, as the README says.
  • Node 22.22 or later is needed to run the checks without engine warnings.

The tests served a copy in _site that only npm run check refreshed, so npm test could pass on stale files and failed on a fresh clone. Everything in site/ is now what gets tested and published.
html-validate 11 needs ^22.22.0 or >=24.8.0, so >=22.13 had gone stale.
The pages use 43 characters, but the fonts carried 202 plus hinting. Together they go from 27.2 KB to 9.9 KB. Text is pixel-identical in Chrome on macOS, which ignores hinting. The existing test flags any character outside the set.
The same 401 points, in 1.4 KB less of index.html. og.png differs in 10 anti-aliased pixels, from rounding as Chrome adds up relative coordinates.
fontkit brought in 11 of the 29 packages for one test. The range matches the command that cuts the fonts.
The dark colors move into the SVG, which also gives the favicon a dark version. Both pages render pixel-identically in light and dark.
One hover rule for every link, which also gives the 404 page's links a hover color. One color-scheme for both themes. Phone spacing is now the default, so the 640px block goes and screens from 641 to 699px get the phone spacing. Drop the default font-style lines.
@bkowshik
bkowshik merged commit 276ceba into main Nov 6, 2026
2 checks passed
@bkowshik
bkowshik deleted the site-cleanup branch November 6, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant