# Document shortcuts (Redirection group "Document Shortcuts")

Set up 2026-08-31 after the Student Handbook link went stale on five pages at once.

## The problem it solves

Pages linked directly to Google Drive file IDs. When a document is reissued, Drive mints a
**new file ID**, so every page linking the old ID breaks — silently, and invisibly from the
page editor (Erin searched "Handbook" in Pages and found nothing, because the pages linked
`/student-handbook`, a redirect, not the document).

## The shape

`brentwood.ca/<slug>` → 301 → the Drive file. Pages link the slug, never the Drive URL.
Reissue a document → change **one** redirect → every page is correct.

Rules live in Redirection under the **"Document Shortcuts"** group (id 4) so they are not
buried among the ~1,000 migration rules. Titles are prefixed `Document shortcut: `.

Both `/slug` and `/slug/` resolve, so either form is safe in page content. The swap script
matched each page's own trailing-slash convention.

## Better than either: version in place

Drive's **Manage versions → Upload new version** keeps the same file ID. Then nothing on the
website needs changing at all. The shortcut is the safety net for when a genuinely new file
is created. This is the first thing to tell an editor.

## Coverage

23 shortcuts, 32 page links swapped across 15 pages. Chosen on two criteria: reissued
annually, or linked from 2+ pages. Deliberately **not** applied to one-off documents
(Brentonian back-issues, stock-giving forms) — a shortcut there is maintenance for no gain.

## Known open items (need the school, not us)

- **Three documents return HTTP 401** (Drive sharing not set to public), on 6 pages:
  Academic Recommendation (School Documents, Application Process), Resources for Teachers/
  Advisors/Coaches (Hub, Students), FRISBE (US Donors, Ways To Give). Shortcuts exist and
  will work the moment sharing is fixed — no website change needed then.
- **Three different viewbooks in circulation**: Admissions page has "Viewbook 2024-25",
  Brentwood Family has "Viewbook CANADA 2026", and the `/viewbook` shortcut serves
  "Viewbook 2025-Aug2025-WEB-spread". Left as found — which is current is the school's call.
  `/viewbook` was briefly repointed during setup and was restored to its original target.
- Some documents are dated well behind the current year (Travel Requirements 2020-21,
  Concussion Policy 2024-25, CIL Classroom Map Aug 2024). Content question, not a link fault.

## Gotcha for future scripted edits

Kadence `singlebtn` blocks legitimately store `<strong>` as `<strong>` inside block
JSON. A corruption guard must compare escape **counts before/after**, not test for presence —
testing presence aborts on healthy pages. And `wp_update_post()` still requires `wp_slash()`
or the backslashes are eaten and the blocks break.
