Skip to content

Add a 404 page for GitHub Pages - #27

Merged
rickychilcott merged 1 commit into
mainfrom
add-404-page
Nov 23, 2026
Merged

rickychilcott merged 1 commit into
mainfrom
add-404-page

Conversation

@rickychilcott

Copy link
Copy Markdown
Member

GitHub Pages serves output/404.html, with a 404 status, for any URL that doesn't exist. Until now the site had no 404 page, so visitors got GitHub's generic one.

Design: the page reuses the homepage's plan hero. The example plan is "Your visit to causey.app", and its goal "Find the page you were looking for" is Off track. Buttons go to the homepage and the blog. Below that, a "Popular places to start" row links to the tour, pricing, the blog, and contact. It's all existing Bookshop components in src/_pages/404.html, with no new CSS.

GitHub Pages details:

  • Built at /404.html (permalink: /404.html).
  • noindex and sitemap: false.
  • Every link and asset URL is root-relative, so the page renders correctly when it's served at a nested missing path like /some/deep/missing-page/.

Spec: test/test_pages.rb checks that /404.html has the h1, noindex, a link home, no relative href/src, and no sitemap entry. Suite: 52 tests, all passing.

I checked it by hand with a local server that mimics GitHub Pages' 404 handling, loading /some/deep/missing-page/ at desktop and mobile widths. All assets loaded, and the only console error was the page's own expected 404.

🤖 Generated with Claude Code

GitHub Pages serves /404.html for any missing URL. The page reuses the
plan hero with a plan where finding the page is off track, then links
to the homepage, pricing, blog and contact. It's noindex, left out of
the sitemap, and uses only root-relative URLs so it works at any depth.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rickychilcott
rickychilcott merged commit 97bf944 into main Nov 23, 2026
2 checks passed
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