Skip to content

docs: server-render a useful 404 page on both sites - #510

Open
vihar wants to merge 1 commit into
masterfrom
docs/not-found-page
Open

docs: server-render a useful 404 page on both sites#510
vihar wants to merge 1 commit into
masterfrom
docs/not-found-page

Conversation

@vihar

@vihar vihar commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Item 3 from the is-agentic scan (after #508, #509; independent of both).

Problem. Unknown paths on both sites return a real 404 status, but the body is an empty app shell — VitePress deliberately writes <div id="app"></div> into the 404.html it generates (even with a custom 404.md; hasCustom404 only affects preload links). Agents and no-JS clients get nothing to recover from, and humans only see content after JS loads:

$ curl -s https://docs.plane.so/does-not-exist | grep -o '<div id="app">[^<]*'
<div id="app">

Fix. One shared component, rendered in two places so humans and agents always see the same thing:

  • packages/theme/src/components/NotFound.vue — "Page not found" with where-to-look-next links: home, search (⌘K), /sitemap.xml, /llms.txt, /llms-full.txt, the other Plane docs site (so someone looking for the API on docs.plane.so gets pointed at developers.plane.so and vice versa), a help link, and a one-line hint for agents (append .md or send Accept: text/markdown). Registered as <PlaneNotFound> and used as the Layout's default not-found slot for client-side navigation to a missing page. Site-specific wording comes from a new notFound option on createPlaneTheme.
  • apps/*/docs/not-found.md renders the component as a normal page so VitePress fully server-renders it; each app's existing buildEnd then moves not-found.html over 404.html and removes the stray not-found.* copies. The page is noindex, search: false, copyPage: false, excluded from llms.txt and filtered out of the sitemap.

Both sites are configured identically apart from the wording (site name, sibling site, help link).

Verification

  • pnpm check:types, check:format, and pnpm build pass.
  • In both dist/s: 404.html contains the full rendered content and all links; <title>Page not found | Plane</title>; robots: noindex, nofollow; not-found/404 absent from sitemap.xml, llms.txt, llms-full.txt; no leftover not-found.html/.md.
  • After deploy: curl -s https://docs.plane.so/does-not-exist | grep -c "Where to look next"1 (and status stays 404).

Checklist

🤖 Generated with Claude Code

https://claude.ai/code/session_01CsPSwTnpsEb5c5Ud2CLrL8

Unknown paths on docs.plane.so and developers.plane.so returned a 404 whose
body was an empty app shell (VitePress deliberately leaves #app empty in the
404.html it writes), so agents and no-JS clients got nothing to recover from.

- packages/theme: new NotFound.vue with the "page not found" content — home,
  search, sitemap.xml, llms.txt, llms-full.txt, the sibling Plane docs site,
  a help link, and a hint for agents (append .md / Accept: text/markdown).
  Registered as <PlaneNotFound> and used as the Layout's default `not-found`
  slot so client-side navigation to a missing page shows the same content.
  Site-specific wording comes from a new `notFound` option on
  createPlaneTheme.
- apps/*: docs/not-found.md renders the component; buildEnd moves the
  server-rendered not-found.html over 404.html and drops the stray copies.
  The page is noindex, excluded from search, llms.txt and the sitemap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CsPSwTnpsEb5c5Ud2CLrL8
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
developer-docs Ready Ready Preview Aug 21, 2026 8:27pm
docs Ready Ready Preview Aug 21, 2026 8:27pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@vihar, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 51b60389-5aaf-4628-8b4c-87be0c900b0c

📥 Commits

Reviewing files that changed from the base of the PR and between aad24bb and 79dd59d.

📒 Files selected for processing (13)
  • apps/developer-docs/AGENTS.md
  • apps/developer-docs/docs/.vitepress/config.mts
  • apps/developer-docs/docs/.vitepress/theme/index.ts
  • apps/developer-docs/docs/not-found.md
  • apps/docs/AGENTS.md
  • apps/docs/docs/.vitepress/config.ts
  • apps/docs/docs/.vitepress/theme/index.ts
  • apps/docs/docs/not-found.md
  • packages/theme/README.md
  • packages/theme/src/components/NotFound.vue
  • packages/theme/src/index.ts
  • packages/theme/src/layout/Layout.vue
  • packages/theme/src/options.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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