wp-packages/internal/http/templates
Ben Word 154cb2f376
Migrate templates from html/template to Jet v6
Replace Go's html/template with CloudyKit/jet/v6 for server-rendered
templates. Jet provides first-class parameterized blocks, template
inheritance via extends/yield, and C-like expressions — eliminating
the dict helper workarounds that html/template required for reusable
components.

Add components.html with four reusable Jet blocks:
- shell(command, variant, class) — copyable command boxes (replaces
  ~16 duplicated instances across 6 templates)
- notice(variant, class) with yield content — alert boxes with
  variant-based styling and content slots
- input(icon, name, ...) — form inputs with icon and keyboard hint
- pagination(pager, class) — pagination controls driven by
  pre-computed buildPagination() data

Key changes:
- templates.go: embed.FS loader for Jet, function registration via
  AddGlobal, buildPagination() helper, render() using VarMap
- handlers.go: simplified render calls (no more template combinations)
- router.go: *jet.Set replaces *templateSet
- All 13 templates converted to Jet syntax (extends/block/yield)
- Tailwind scanning unaffected (templates remain .html files)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:05:25 -05:00
..
404.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
admin_layout.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
admin_logs.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
compare.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
components.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
detail.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
docs.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
index.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
layout.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
package_results.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
status.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
untagged.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
untagged_results.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00
wordpress_core.html Migrate templates from html/template to Jet v6 2026-04-05 14:05:25 -05:00