Legal & Policy Documentation System
User-facing legal/technical policy site at theaccessible.org/legal. Distinct from the
internal/user docs at apps/web/docs. Source of truth is markdown in-repo; approval is a
PR merge; prior versions remain accessible.
Locations
| Thing | Path |
|---|---|
| Content | apps/home/src/content/legal/<slug>/<version>.md |
| Loader | apps/home/src/lib/legal.ts |
| Routes | apps/home/src/app/legal/ |
| Review reminder script | scripts/check-legal-reviews.mjs |
URL structure
| URL | What |
|---|---|
/legal | Index of all approved documents |
/legal/<slug> | Current approved version |
/legal/<slug>/history | Version list for one document |
/legal/<slug>/v/<version> | Specific version (with archived banner if not current) |
Frontmatter schema
---title: Privacy Policy # displayed headingslug: privacy # URL segment β must match folder nameversion: "1.0" # dotted numeric; sorted numericallystatus: draft # draft | approved | archivedpublishedAt: "2026-04-21" # ISO date or nullreviewBy: "2027-04-21" # ISO date or null β drives review reminderapprovedBy: "Larry Anglin" # string or nullsupersedes: null # prior version string, or nullsummary: Short one-line description for the index and meta description.---Workflow
Creating a new document
- Pick a slug (kebab-case). Create
apps/home/src/content/legal/<slug>/1.0.md. - Fill in frontmatter with
status: draft,publishedAt: null,reviewBy: null,approvedBy: null. - Write the body in markdown.
- Open a PR. Drafts are visible in
npm run devand in any build whereLEGAL_SHOW_DRAFTS=1is set β they are not built into production.
Approving a document
- On the PR, change
status: approved, setpublishedAtto today, setreviewBy(typically 1 year out), and setapprovedByto the approverβs name. - Merge the PR. The next deploy publishes the document.
Publishing a new version
- Create
apps/home/src/content/legal/<slug>/<new-version>.mdwith the new content. - Set
supersedesto the previous version number. - Mark the previous fileβs
status: archivedin the same PR. - Approve and merge.
The index page shows the highest-version approved file as current. The history page lists every version (current, archived, and β in admin builds β drafts).
Admin preview of drafts
cd apps/homeLEGAL_SHOW_DRAFTS=1 npm run dev# orLEGAL_SHOW_DRAFTS=1 npm run buildReview reminders
scripts/check-legal-reviews.mjs scans all approved documents and emails a summary to
Larry when reviewBy is within 60 days or past due. Run nightly via cron:
0 8 * * * cd /path/to/accessible && node scripts/check-legal-reviews.mjsThe email is sent via ~/.claude/scripts/send-email.sh. Output when nothing needs
attention is a single nothing to report log line.
Design decisions
- Git = audit trail. Who approved what and when is captured by the merge commit + frontmatter. No separate approval database.
- Static export. Pages are prerendered at build time; no runtime DB required.
- Drafts are build-gated, not auth-gated. Draft markdown isnβt shipped to production at all. This avoids needing an auth layer on a static site. Admins preview via local dev or a preview branch build.
- Archived versions stay live at
/legal/<slug>/v/<version>/with a visible βarchivedβ banner androbots: noindexso they donβt compete with the current version in search. - Trusted-content HTML rendering. Rendered HTML comes from
marked(...)applied to markdown that is author-controlled and merged only via PR review. No user input reaches this renderer, so sanitization is not required. If the pipeline ever changes to accept untrusted input, add DOMPurify before rendering.
Initial document set (16)
Privacy Policy, Terms of Service, Accessibility Statement, AI & ML Disclosure, Subprocessors, Data Retention Policy, Security Overview, Cookie Policy, DSAR Procedure, Data Processing Addendum, Vulnerability Disclosure Policy, DMCA Copyright Policy, Refund & Cancellation Policy, Acceptable Use Policy, Service Level Agreement, Breach Notification Policy.
As of 2026-04-21 only the Accessibility Statement is approved; the remaining 15 are scaffolded as drafts awaiting content and legal review.