Skip to content

docs(middleware): add custom recovery behavior page across all locales - #414

Merged
appleboy merged 1 commit into
masterfrom
docs/add-custom-recovery-middleware
Jun 22, 2026
Merged

appleboy merged 1 commit into
masterfrom
docs/add-custom-recovery-middleware

Conversation

@appleboy

Copy link
Copy Markdown
Member

Summary

The upstream Gin docs (doc.md) include a "Custom Recovery behavior" section (gin.CustomRecovery) that was the only topic with no equivalent on this site. This PR adds that page across all 12 locales and inserts it into the Middleware sidebar right after Custom Middleware.

A full cross-check of doc.md against src/content/docs/en/ confirmed every other upstream section is already covered — this was the single gap.

Architecture / flow

The change adds one new page and shifts the sidebar.order of the later Middleware pages by +1 (consistently in every locale) to open the order=4 slot:

flowchart TD
    A[1 · without-middleware] --> B[2 · using-middleware]
    B --> C[3 · custom-middleware]
    C --> NEW[4 · custom-recovery]
    NEW --> D[5 · error-handling-middleware]
    D --> E[6 · using-basicauth-middleware]
    E --> F[7 · index]
    F --> G[8 · goroutines-inside-a-middleware]
    G --> H[9 · security-headers]
    H --> I[10 · security-guide]
    I --> J[11 · session-management]
    J --> K[12 · dependency-injection]
    style NEW fill:#dff0d8,stroke:#3c763d
Loading

New page (green) inserted at order 4; pages 5–12 are the renumbered existing files (was 4–11). Same numbering applied identically across all 12 locales to preserve the cross-locale order invariant established in d6142b754b.

AI Authorship

  • AI was used. Details:
    • Tool / model: Claude Opus 4.8 (Claude Code)
    • AI-authored files: all 12 custom-recovery.md pages (English written, then translated per-locale by sub-agents matching each locale's existing terminology/conventions) and the 96 one-line order: frontmatter bumps
    • Human line-by-line reviewed: TODO — @appleboy to confirm review scope (English page + a spot-check of translations recommended)

Change classification

  • Leaf node (local impact) — documentation only; no code depends on it. Failure mode is limited to rendered docs.
  • Core code

Plan reference

Goal: close the one content gap between upstream gin/docs/doc.md and this site's English docs, keeping all locales and sidebar ordering in sync. Scope: middleware docs only — add custom-recovery.md ×12 + renumber sibling order: ×12 locales. No code/config changes.

Verification

  • Unit tests — N/A (docs)
  • Integration tests — N/A
  • e2e tests — N/A
  • Site builds: npm run build → 1226 pages built, no errors (only benign Pagefind stemming notes). Confirms frontmatter and internal links are valid.
  • Manual verification: run npm run dev, open /en/docs/middleware/custom-recovery/, confirm the page renders and appears 4th in the Middleware sidebar; spot-check one RTL locale (/ar/ or /fa/).

Verifiability check

  • Content faithfully mirrors the canonical upstream example
  • ## Try it section uses H2 per site convention; ## See also cross-links use correct per-locale prefixes (verified: no /en/ leaks in translated files)
  • Build failures would surface broken links / frontmatter in CI

Risk & rollback

  • Risk: Low. Worst case is a sidebar mis-ordering or an untranslated string slipping through; no runtime impact.
  • Rollback: revert the single commit f183515fc3.

Reviewer guide

  • Read carefully: en/docs/middleware/custom-recovery.md (source of truth for all translations).
  • Spot-check OK: the 11 translated custom-recovery.md files (mechanical translations of the English source) and the 96 order: bumps (uniform +1, build-verified contiguous 1–12 in every locale).

- Document gin.CustomRecovery for customizing panic recovery handling
- Add the page to all 12 locales with a runnable example and Try it section
- Insert at sidebar order 4 after Custom Middleware
- Renumber later middleware pages consistently across every locale
@appleboy
appleboy merged commit 709e314 into master Jun 22, 2026
2 of 3 checks passed
@appleboy
appleboy deleted the docs/add-custom-recovery-middleware branch June 22, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant