Fixes, all found while migrating a real site off Nuxt Content and none of them
visible from the playground alone.
- Keep the host application's layout out of the dashboard: its header, footer and
navigation used to wrap /__eponyme, since a Nuxt page inherits the default
layout unless it opts out
- Resolve Nuxt aliases in `prismaClient`. `~~/` and `@@/` point at the project
root, `~/` and `@/` at srcDir, which matters because `server/` sits at the root
while `~/` is `app/` in Nuxt 4. The documented value could not work before
- Declare slugify and sortablejs in optimizeDeps: both are CommonJS-only, and
their default export went missing in dev when reached through this module
Features:
- Sort, limit and paginate collections. `useEponymeCollection(name, { take, skip,
orderBy, order })` returns `{ entries, total }`. Sorting accepts the entry
metadata and any schema field, so articles can be ordered by their own date.
Sorting and slicing run after unpublished entries are filtered out, because the
status lives in the JSONB envelope and a database-side limit would spend slots
on rows that get dropped
- Content variables. Editors insert `{{ currentYear }}` in any text field and the
value is resolved when the page is served. Seven date built-ins, plus custom
ones declared in `eponyme.variables.ts`, listed behind a toolbar button in the
rich text editor. Names only, never expressions: content is editable from the
dashboard, so evaluating it would grant arbitrary code execution