Example page: how a public page is built

This page is a reference, not content. Copy src/app/example/ when you add a public page, then delete it and its entry in PUBLIC_ROUTES before the site goes live.

The six things it does

  1. Exports metadata through publicPageMetadata, which is what makes it indexable and gives it a canonical URL.
  2. Writes a title and description inside the lengths search engines display in full.
  3. Registers /example in PUBLIC_ROUTES, which is the only thing sitemap.xml reads.
  4. Renders structured data from the same list the page displays, so the two cannot disagree.
  5. Uses exactly one h1, with every subsection an h2 beneath it.
  6. Links to related pages, which is how crawlers reach them and how readers stay.

Headings

One h1 per page, stating what the page is. Everything under it steps down one level at a time — an h2 never jumps to an h3 with nothing in between. Screen readers navigate by that order, and search engines read it as the page's outline.

Images

There are none here because the boilerplate ships none. When you add one, use next/image so it is served as WebP or AVIF at the right size, give it real alt text describing what it shows, and set priority on the one image above the fold.

Questions this page answers

Does every public page need its own description?
Yes. Without one the page inherits the site-wide description, so every result in Google reads the same and none of them describe the page that was found.
What happens if I forget to add the route to PUBLIC_ROUTES?
The page works and is indexable, but it is missing from sitemap.xml, so search engines only find it by following a link. Nothing fails to warn you, which is why the two edits belong in one change.
How long should a title and description be?
Around 50 to 60 characters for a title and 120 to 160 for a description. Past that Google truncates them, and the part it cuts is usually the part that would have earned the click.

Related

The rules behind all of this are in docs/seo.md, and the launch steps are in docs/seo-launch.md. For a page that should not be indexed, use privatePageMetadata instead — the sign-in page is the worked example.

HomePrivacyTerms