Repository navigation
Add a 404 page for GitHub Pages - #27
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
/404.html(permalink: /404.html).noindexandsitemap: false./some/deep/missing-page/.Spec:
test/test_pages.rbchecks that/404.htmlhas the h1,noindex, a link home, no relativehref/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