Add buildPaginationModel and ctx.assetHref, and bump the plugin contract to 0.5.0
CI / full-gate (push) Failing after 5s

This commit is contained in:
2026-11-08 14:32:05 +01:00
parent 01f368d663
commit 404f2584ac
20 changed files with 189 additions and 100 deletions
+19
View File
@@ -6,6 +6,25 @@ at boot. Entries start at 0.3.0.
## Unreleased
### Plugin contract 0.5: set `apiVersion` to `"0.5.0"`
The host's contract version is now 0.5.0, so discovery refuses a plugin whose `apiVersion` is still
`0.4.x`. Change the literal in each plugin's manifest when you upgrade; nothing else in a 0.4 plugin
needs to change.
### `buildPaginationModel` builds the pagination partial's model
`buildPaginationModel(page, hrefFor, { label?, pageSizes? })` from `@plainpages/plugin-api` turns
`paginate()`'s result into what `partials/pagination` renders. `hrefFor(n)` is your list's URL on
page n, and the rows-per-page form carries the same list state as the links. It replaces the hand-written
mapping a list page needed.
### A plugin can version its own `/public/` files
Wrap a script, image or other file your own markup links in `assetHref("/public/<id>/…")` in a view,
or `ctx.assetHref(…)` in a handler. The href gets the file's content hash, and the browser caches the
file for a year instead of revalidating it every five minutes.
### Discovery warns when a gate names a permission no plugin declares
A route or nav node that gates on a permission no installed plugin declares now logs a boot warning