A site with 286 pages has a link problem. Every new page is an orphan until something points at it, and every redesigned URL silently breaks old links. I stopped doing this by hand a while ago.
The problem with manual internal links
I started by adding a "related reading" section to each page as I wrote it. That worked for the first twenty pages. By page eighty I was linking to the same six popular articles over and over, and a bunch of older pages had no incoming links at all.
The cause is simple: when you write a new page, you can only link backwards to things that already exist. Nothing links forward to it unless you go back and edit old pages, which nobody enjoys doing.
What the script does
The generator reads all content files, groups them by topic, and for each page picks a few other pages from the same topic group. It writes the related-reading links into the page at build time.
Because it runs after all pages are known, it can link forward as well as backward. Every page gets at least two incoming links, and no page is an orphan.
I also added a check that runs after the build: it parses every generated page, extracts the internal hrefs, and verifies each one resolves to a real output file. That is how I caught a bug where my first version was looking at the wrong path segment and reporting false successes.
Keeping it from feeling automated
A naive related-reading block links to whatever is nearest in a list. That reads like machine output. I kept a small amount of human input: each topic group has a hand-picked label, and the links are rendered as a short "read next" line rather than a wall of cards.
The result looks deliberate to a reader, but the maintenance is automatic. When I add a page, the whole network updates.
The check I run every time
Before deploying I run a single command that reports three numbers: total pages, orphans, and broken internal links. If the last two are not zero, I do not deploy. It takes a second and has caught more problems than any manual review.
For anyone running a growing static site: treat internal links as generated data with a validation step, not as prose you write once and forget.

