DEV Community

Daniel Pertu
Daniel Pertu

Posted on

We added 35 pages in one commit. They link to the older pages 97 times, and the older pages link back four times

Every public page on our marketing site is a node in one array. Path, title, heading, description, cluster, the date the content last changed, and the sideways links it carries:

{
    path: '/guides/pub-quiz-rules',
    title: 'Pub Quiz Rules, Ready to Read Out',
    shortLabel: 'Quiz rules',
    heading: 'Pub quiz rules, ready to read out',
    description: 'Nine house rules to read out in under a minute, why each one exists, ...',
    cluster: 'guides',
    updated: '2026-11-16',
    related: [
        '/guides/how-to-be-a-good-quizmaster',
        '/guides/pub-quiz-cheating',
        '/guides/pub-quiz-scoring-systems',
        '/quiz-questions/tie-breakers',
    ],
}
Enter fullscreen mode Exit fullscreen mode

The sitemap, the footer, the hub index each page belongs to, its breadcrumbs and its related-links block are all derived from that array, which means the internal link graph of the site is a data structure I can measure rather than a thing I have to crawl to find out about.

Last month it was 69 nodes. One commit took it to 108, and I ran the numbers again.

The graph as it stands

nodes                                 108
`related` edges                       395
rendered outbound links (incl. hub)   698
related links per page                2 to 5
distinct linked pairs                 318
reciprocal pairs                       77
one way edges                         241
within-cluster edges                  222
cross-cluster edges                   173
broken edges                            0
Enter fullscreen mode Exit fullscreen mode

Nothing points at a page that does not exist, which is one of 21 assertions a vitest file makes about this array. Every page has somewhere to go. Every spoke links up to its hub and every hub links down to all of its spokes.

Then the number I did not expect.

97 out, four back

Of the 35 pages in that commit, 51 of their related links point at each other and 97 point at pages that already existed. The 73 older pages added four links to the new ones between them.

new page -> new page        51
new page -> older page      97
older page -> new page       4
Enter fullscreen mode Exit fullscreen mode

That ratio is not a mistake anybody made. It is the shape of the work. Adding a page means writing one node, and a new node naturally reaches for the established pages: the round ideas guide, the pricing page, the general knowledge questions. Giving that page inbound links means going back into 97 other nodes and editing their related arrays, which is a second commit nobody schedules, on pages that are already finished.

So a site that grows in bursts grows a link graph where link equity flows one way, from the new pages to the old ones, and the pages that most need help ranking are the ones with almost nothing pointing at them. The hubs hide it, because a hub index does list every spoke, so nothing is technically unreachable.

Twelve pages with no sideways link in

0 inbound related: 12 pages
1 inbound related: 19
2 inbound related: 17
3 inbound related: 15
4 inbound related: 11
5 inbound: 9, 6 inbound: 9, 7 inbound: 6, 8 inbound: 5
12 inbound: 2
15, 16, 17 inbound: one page each
Enter fullscreen mode Exit fullscreen mode

Four of the twelve are a hub or the homepage, which every page in the site links to through the header and footer, so they do not need a sideways link. The other eight are spokes, and seven of the eight are from the new commit:

You can check any of them in two requests. The hub lists it:

$ curl -s https://pub-trivia.app/quiz-questions | grep -c 'href="/quiz-questions/football"'
1
Enter fullscreen mode Exit fullscreen mode

And its siblings do not:

$ curl -s https://pub-trivia.app/quiz-questions/general-knowledge | grep -c 'href="/quiz-questions/football"'
0
$ curl -s https://pub-trivia.app/guides/pub-quiz-round-ideas | grep -c 'href="/quiz-questions/football"'
0
Enter fullscreen mode Exit fullscreen mode

The hub page itself carries 68 distinct internal hrefs, 35 of them its spokes and the rest navigation, and a spoke page carries 33 to 35. So no page is more than a couple of clicks from any other by going up to a hub and back down, which is a fine structure, and not the same thing as being linked to.

The test that passes, and the test I should have written

There is an orphan assertion already, and it has been green the whole time:

it('leaves no page orphaned', () => {
    // The header and footer are on every page, so what they link to counts.
    const inbound = new Set<string>(globalNavPaths())
    for (const node of CONTENT) {
        for (const path of outboundLinksFor(node.path)) inbound.add(path)
    }
    for (const node of CONTENT) {
        expect(inbound.has(node.path), `nothing links to ${node.path}`).toBe(true)
    }
})
Enter fullscreen mode Exit fullscreen mode

A Set of paths, and a membership check. It is true, and it is the weakest true thing in the neighbourhood. A set cannot tell you that seven pages are sitting at exactly one inbound link, because one is not zero. The assertion I wanted all along is a floor on a count rather than a check on a set: every spoke needs at least one inbound link that is not its own hub. It would fail today, seven times, which is the argument for writing it.

The second one worth having is a cap, not a floor. Our most linked page takes 17 inbound sideways links and the next two take 16 and 15, all three of them pages that were in the first 20 nodes. Left alone, a registry rewards whatever was there first, forever.

Reciprocity is not the goal

318 distinct pairs are linked and 77 of them link both ways. For a while I thought that number should be higher, and then I worked out what a high number would cost.

related is a hand written list of the three or four pages a reader of this page would actually want next. If every one of those links had to be mutual, then every page would carry a related block made of whichever pages link to it, rather than whichever pages it is about. The guide to quiz rules should send you to the tie breaker questions. The tie breaker questions should send you to the guide. Those are reciprocal because both directions are useful, and that is the only reason reciprocity is worth anything.

What the 4 against 97 tells me is different: not that the links should be mutual, but that an established page is allowed to notice a newer one. Four times out of 97 is not noticing.

Look at the graph yourself

The whole public structure is in the sitemap, 111 URLs, and every page carries its related block at the bottom and its breadcrumb at the top. Start at the questions hub, click into any category, and count how many of the links at the bottom of that page point sideways rather than up. If the answer is two or three, you are looking at one of the 31 pages with at most one sideways link coming in, and now you know how it got that way.

Top comments (0)