mirror of
https://github.com/roots/wp-packages
synced 2026-07-21 16:16:53 +08:00
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> |
||
|---|---|---|
| .. | ||
| static | ||
| templates | ||
| admin_auth.go | ||
| admin_auth_test.go | ||
| api_monthly_installs.go | ||
| api_monthly_installs_test.go | ||
| api_rate_limit.go | ||
| api_rate_limit_test.go | ||
| api_stats.go | ||
| api_stats_test.go | ||
| changes.go | ||
| changes_test.go | ||
| composer.go | ||
| composer_test.go | ||
| downloads.go | ||
| downloads_test.go | ||
| handlers.go | ||
| login_rate_limit.go | ||
| middleware.go | ||
| router.go | ||
| router_test.go | ||
| seo.go | ||
| server.go | ||
| tailwind-input.css | ||
| templates.go | ||