Dev.to WebDev 🛠 Dev 👁 0 📖 6 min read

I crawled all 1,093 of our pages: the 409 deepest now have 11 ways in, and the only stragglers are the 3 outside the registry

CogniPrep has a page per assessment a candidate might be sent: 409 of them at /games/<provider>/<test>. They are the deepest pages on the site and the ones that match what people actually type. Until this week they were

CogniPrep has a page per assessment a candidate might be sent: 409 of them at /games/<provider>/<test>. They are the deepest pages on the site and the ones that match what people actually type.

Until this week they were also the worst connected. A test page's only inbound links were its provider hub's game card and a list on its sibling test pages. The /cheating guide about the same provider, the blog post that names the same tests, the test-format hub about the same category: none of them linked in. The diff that fixed it is tiny, and the measurement afterwards found the three pages it could not reach.

The shape of the fix

One shared component, used on three different page types:

/**
 * A titled list of links to per-test pages (/games/<provider>/<test>), closed
 * by a link back to the provider hub.
 *
 * Shared by the test pages themselves (their sibling tests) and by the
 * /cheating guides, so every page about a provider links into each of that
 * provider's test pages with the same anchor text: the phrase candidates type
 * (`searchName`), not the short label.
 */
export function TestPageLinkList({ provider, entries, heading, intro, headingClassName }) {

The whole commit is 14 files: two new components of 69 and 36 lines, seven hub pages gaining a few lines each, and three shells switching to the shared list. The cheating guide shell is the clearest evidence of the gap, because its diff is 17 insertions and zero deletions. There was nothing there to replace.

{/* The provider's per-test pages, so a reader who came for a shortcut
    finds how each named test actually works. */}

The anchor text decision

The old sibling list used item.label, the short internal name. The shared one uses a helper:

export function testPageLinkText(entry: TestPageEntry): string {
  if (entry.searchName) return entry.searchName;
  const provider = PROVIDER_META[entry.provider].label.split(' / ')[0];
  return `${provider} ${entry.label}`;
}

406 of the 409 pages carry a searchName, so nearly every internal link into them now reads as the phrase a candidate would type rather than as our shorthand. The fallback trims the vendor's formal name: Aon / cut-e becomes Aon, Assessio (Matrigma & MAP) becomes Assessio.

This is the opposite of the usual advice about varying anchor text. The reasoning is that these pages exist to answer one phrase each, and a link whose text is that phrase tells a reader exactly what they will get. Consistency is the feature.

Hub headings that link themselves

Each provider hub has a "what each game involves" list. Those headings are now conditional links:

/**
 * When the game has a test page (/games/<provider>/<test>) the heading links to
 * it, so a reader who wants more on one game gets there in one tap; otherwise
 * it is a plain heading. The lookup is by game id, so a page added later is
 * linked without touching the hub.
 */
const page = gameId ? testPageForGame(gameId) : undefined;

That last sentence is the point of the whole design. 409 pages map to 438 game ids, and when the 410th page lands, the hub links it with no edit, because the hub asks a registry rather than holding a list.

The blog shell does something similar with one line of inference:

// A post whose games all come from one provider is about that provider, so
// it also lists every one of that provider's test pages: the post names more
// games than its practice cards can show.
const providers = [...new Set(relatedGames.map((game) => game.provider))];
const postProvider = providers.length === 1 ? providers[0] : undefined;

No new field in the blog registry, no editorial pass over 121 posts. A post that mentions games from two providers is not about one provider, and gets nothing.

On a phone, four links and the rest still in the HTML

A list of 17 sibling tests is fine on a laptop and absurd on a phone. The collapse is CSS only:

const HIDE_AFTER = {
  3: 'max-md:[&>*:nth-child(n+4)]:hidden',
  4: 'max-md:[&>*:nth-child(n+5)]:hidden',
} as const;
The hidden items stay in the HTML, only hidden with CSS, so their links are
still there for search engines and nothing has to load on tap.

A "Show more" that fetches, or that renders the rest only after a click, is a link block that a crawler sees four links in. This one has every link in the markup, and the phone just does not draw them yet.

Then I crawled the whole site

Internal-link work is easy to believe in and hard to be right about, so: every URL in the sitemap, hrefs only, five at a time.

1,093 URLs, 1,093 answered 200, 92 seconds, 58,030 internal link instances. Zero orphans. 36 destinations are linked from more than 95 per cent of pages, which is the header and footer, and they get separated out before any claim about a page family.

For the 409 test pages: 4,755 inbound links, a floor of 5, a median of 11, a mean of 11.6 and a maximum of 25. The distribution by where the link comes from:

Source Links in
Sibling test pages 2,683
Blog posts 595
Test-format pages 420
Provider hubs 410
Cheating guides 409
Employer guides 134
Answer pages 69
Benchmark pages 28
Dutch and German pages 6

Two things worth reading off that table. The first is that 2,683 of 4,755 are the family linking itself, which is cheap and not worth much; the 2,072 links from other families are the ones that changed anything. The second is the 409 from cheating guides: exactly one per test page, because each provider's guide lists each of that provider's tests once. A number that lands exactly on the page count is usually a sign the block is derived rather than written, which is what you want.

The three pages the fix could not reach

Nine pages sit on the floor of 5, each getting its hub, a sibling, a cheating guide, a test-format page and a blog post. Nothing under that.

Except that my first pass at this measurement said the minimum was 1, and the page was /games/arctic-shores/practice-scores. It is one of three score-benchmark pages that live under /games/<provider>/ in a route group, look exactly like test pages in a URL bar, and are not in TEST_PAGES.

Every link block in this commit is derived from that registry. testPagesForProvider, testPageForGame, the sibling list, the cheating guide block, the blog block: all of them read the same array. So the three pages outside it got nothing, and they still have an in-degree of 1, 2 and 2. The two that reached 2 did so because an /answers page happens to mention them in prose.

That is the honest cost of derived navigation, and it is worth stating plainly because it is not obvious: a link block built from a registry gives you perfect coverage of the registry and exactly zero coverage of everything else. The pages at risk are never the ones you are thinking about while you write the component.

See it

Open the Arctic Shores cheating guide and scroll to the bottom. "The Arctic Shores tests explained", 14 links, one per test page. That block did not exist last week.

Then open the Arctic Shores hub and look at the per-game list: every heading is a link now, and the hub emits 15 links into its own test pages. On a phone the sibling list on any test page shows four items and a "Show more"; view source and count the href="/games/arctic-shores/ occurrences, and they are all there. That page, arrows, is the best connected of the 409 at 25 inbound links.

Then try practice-scores on the same provider. Same URL shape, same site, and one way in: its provider hub, and nothing else on 1,092 other pages, because it is not in the array every link block reads.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.