The public site of CogniPrep Assess has 64 indexable pages, and most of them are produced from data, not typed: one page per measured ability, one per starter role profile, one per glossary term, one per candidate task guide. You can see the full list at /sitemap.xml. This post is about the rule that keeps that list honest, which is that a page may never mention something that does not exist.
The sitemap is a function of three lists
The whole sitemap file is a few lines:
export default function sitemap(): MetadataRoute.Sitemap { const paths = [...new Set<string>([ ...PUBLIC_PATHS, ...CANDIDATE_GUIDE_PATHS.map((p) => p.href), ...EMPLOYER_GUIDE_PATHS.map((p) => p.href), ])]; return paths.map((path) => ({ url: absoluteUrl(path), changeFrequency: path === '/' ? 'weekly' : 'monthly', priority: path === '/' ? 1 : LEGAL.includes(path) ? 0.3 : 0.7, })); } PUBLIC_PATHS is typed by hand, for the pages that are one of a kind. The two guide lists are built by mapping over the product's own registries:
...listDimensions().map((d) => ({ href: dimensionHref(d.key), label: d.name, group: 'measures' })), ...STARTER_PROFILES.map((p) => ({ href: profileHref(p.key), label: profileHeading(p), group: 'roles' })), ...GLOSSARY_TERMS.map((t) => ({ href: glossaryHref(t.slug), label: t.term, group: 'glossary' })), So adding a starter role profile to the product adds a page, a footer link and a sitemap entry in one change, and nobody remembers three places. The Set is there because the same path can legitimately appear in two lists, and a duplicate URL in a sitemap is noise.
The same lists feed the header, the footer and the sitemap. That is the part I would copy. If three navigation surfaces each keep their own list, they will disagree within a month.
Dynamic routes that refuse to guess
Every generated page is a dynamic route that says no to anything it was not told about:
export const dynamicParams = false; export function generateStaticParams() { return GLOSSARY_TERMS.map((term) => ({ term: term.slug })); } With dynamicParams = false, a slug outside the list is a 404 at the framework level, not a page that renders with empty content. The page itself also calls notFound() when a slug resolves to nothing, as belt and braces. Try it: /glossary/percentile is a page, and a made-up term is not.
The guide data is also written so that it cannot name something missing. The comment at the top of the file states the rule: slugs, look-ups and phrasing are all read from the task registry and the starter profiles "so a page never names a task, dimension or profile that does not exist". Because the words come from the registry and not from a paragraph somebody typed, a retired dimension would drop out of the pages and the sitemap with no one deleting it.
Titles that fit, chosen by a function
Search results cut a title at around 60 characters, and every page here has our brand name appended. The helper takes several candidate titles, longest and most descriptive first:
title: guideTitle(`${term.term}: meaning in hiring`, `${term.term} explained`, term.term), It returns the first that fits with the suffix. If none fit with it, it takes the first that fits without it. A long role name falls back to a shorter wording instead of being truncated mid-word, and we never wrote a title by counting characters by hand. The meta description does the same with an ordered list of choices and takes the first one at or under 160 characters.
Each page sets its own canonical address, which matters when the same content can be reached with a trailing slash or a query string. Glossary pages also carry structured data for a defined term, built from the same fields as the visible page.
What stays out
robots.ts is the mirror image of the sitemap. It allows the public site and disallows everything that is behind a link token or a sign-in: candidate links, status and offer pages, reports, the app, the admin, the API. A candidate's personal link should not be findable by a search engine even by accident, so those prefixes are listed by name. Job pages have their own sitemap, because they come and go with open roles.
A short checklist
- One list per kind of page, read by the nav, the footer and the sitemap.
- Generated routes with
dynamicParams = false. - Page copy that reads names from the registry it describes.
- A title helper with fallbacks, so length is never a manual job.
- A robots file that names every private prefix.
To see the result, /roles lists the role profiles, /what-we-measure lists the abilities, and /glossary lists the terms. Each of those is generated from the lists above. If you would like to talk to us about what a role needs, book a demo.
