Render Markdown in glossary term titles and related terms

Merged
LU
4d ago
+61-7

Glossary term titles and related terms now render their inline Markdown. This is content-review item clusters-glossary-31, alternative 2.

What changes

  • layouts/partials/doors/term_title.html escapes the title and runs it through markdownify before the <bdi> wrap. The A–Z side card, the breadcrumb and the <h1> now show "Research Contribution Metric (p)" with an italic p, not (*p*). Slugs and en_title matching are unchanged.
  • layouts/partials/functions/resource_metadata.html gives glossary pages a plain-text title (markdownify | plainify) for <title>, og:title and JSON-LD. Those now read "Research Contribution Metric (p) | FORRT".
  • layouts/glossary/single.html, related terms:
    • * and \ are stripped before the slug is built.
    • The link text is rendered with markdownify.
    • The committed content on this branch still has *P*\-hacking and *P*\-value fishing. They now link to /glossary/english/p_hacking/ and show an italic P; before, they showed the raw text with no link.
  • scripts/check_seo_html.py: new hard check 18 fails (numbered 18 because #1083 adds a 17) if a glossary page's <title> or <h1> shows paired asterisks. A lone asterisk passes, as in "G*Power". Unit tests are added. With the old title partial the check fails on glossary/english/research_contribution_metric__p_/.

Launch step: restore the italic p in related terms

On 8 November, ten Related_terms cells in the Glossary sheet (tab glossaries) were changed to plain text, because main shows the asterisks as typed and the asterisks break the link slug. Once this branch is live, the italics can go back. Use lowercase, with no backslash:

CellPlain nowRestore to
G19p-value*p*-value
G92, G158, G196, G218, G247p-hacking*p*-hacking
G161p-hacking; p-value*p*-hacking; *p*-value
G195p-hacking; p-value fishing; … Reverse p-hacking*p*-hacking; *p*-value fishing; … Reverse *p*-hacking
G239, G253p-value*p*-value

Term titles stay plain ("p-value", "p-hacking"), because an asterisk in a title changes its slug (_p_value).

Not changed

Checks: hugo --gc --minify builds. scripts/check_seo_html.py passes all checks, including the new check 18. The unit tests pass (130). I looked at the built term pages and the A–Z list.

🤖 Generated with Claude Code