A 404 page that suggests what the address was for
The closest static pages and public records to the failed address (suggest.ts: letter-pair likeness of the address's last part to each URL ID and name, and of the whole address to each path), so a typo, a missing hyphen or an old /chapters/ link still finds its page; the main pages below to start from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
499662b59a
commit
79c4b243f5
3 changed files with 202 additions and 12 deletions
|
|
@ -48,6 +48,9 @@ export const siteUrl = (path: string): string => new URL(path, SITE_ORIGIN).href
|
|||
|
||||
const PAGES: Record<string, PageText> = { ...siteConfiguration.pages, ...fromServer.pages }
|
||||
|
||||
/* Every static page's path and text, for the not-found page's suggestions. */
|
||||
export const SITE_PAGES: Readonly<Record<string, PageText>> = PAGES
|
||||
|
||||
/** A static page's title and intro, from site.json's "pages". */
|
||||
export function sitePage(path: string): PageText {
|
||||
const page = PAGES[path]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue