Glossary: related terms come from their own sheet tabs, so 748 links instead of 690

LU
2d ago
+182-11

About a third of the glossary's related terms (397 of 1,087) linked nowhere. They were typed freely into the Related_terms column, and the template guessed matches by spelling. The related terms now live in their own tabs of the Glossary sheet, already cleaned up. The generator now reads those tabs and matches names exactly, so the sheet decides what links instead of the code.

  • related_terms tab: one row per term and related name. The names are exact entry titles, so editors pick them from a dropdown. A name with no entry yet stays as plain text, and links by itself once the entry is written (see #1213).
  • related_terms_linking tab: maps other names to an entry, e.g. Alpha error → Type I error. When an editor types one of these names as a related term, it links to the entry. A name can map to two entries: Anonymous review covers single-blind and double-blind review. The names ticked show_as_aka go into a new also_known_as list on English pages. No template displays them yet; showing them and using them in search is a separate change for the Doors templates.
  • Unchanged: the Related_terms column is kept as the dated backup tab and is no longer read. Translated pages still use the English list.

The logic is in scripts/glossary_related.py, with unit tests.

Checked:

  • I ran the generator against the live sheet. All 262 English pages have exactly the related_terms tab's lists, the German and Turkish pages reuse them, and 28 pages get other names.
  • 748 related terms now link, up from 690.
  • The regenerated pages are not committed. They arrive with the next regenerate_glossary run, which also rebuilds apa_lookup.json first, so the three new citation keys (PatelEtAl2015, Stigler1980, MarkiewiczEtAl2021) resolve.
  • I haven't run a Hugo build of the regenerated pages. The main template matches related terms by title, and every linked name is now an exact title.

Created with Claude Opus 5.5 in Claude Code.


Summary by cubic

About a third of the glossary's related terms (397 of 1,087) previously linked nowhere, because the generator matched free-text names to entries by spelling. Related terms now come from two new tabs on the Glossary sheet and are matched by exact entry title, so 748 related terms link instead of 690.

  • The related_terms tab stores one row per term and related name; names are exact entry titles picked from a dropdown (matched ignoring case), and a name without an entry yet stays as plain text until the entry exists.
  • The related_terms_linking tab maps other names to entries (e.g. Alpha error → Type I error) and lets one name map to several entries, like Anonymous review covering both single-blind and double-blind review.
  • Names ticked show_as_aka populate a new also_known_as list on English pages; no template displays it yet.
  • The template now finds each related page by its English title, in the page's language first then English, instead of guessing from the slug, so titles with brackets like "Null Hypothesis Significance Testing (NHST)" link.
  • The old Related_terms column is kept as a backup tab and is no longer read; translated pages still reuse the English list.
  • A run that finds every reference now deletes missing_references.txt, since the file was only rewritten when keys were missing and kept stale entries after they were fixed.
  • The regenerated pages aren't committed here; they land with the next regenerate_glossary run, which rebuilds apa_lookup.json first.