PraxisJS

@praxisjs/content

Changelog for @praxisjs/content — markdown content collections with @Collection, ContentSchema, and Vite plugin.

@praxisjs/content

0.1.0

Initial release — markdown content collections for PraxisJS.

  • ContentSchema base class — extend to define the frontmatter shape via class fields with default values
  • @Collection('./path/*.md') class decorator — registers the collection and its glob path; the Vite plugin expands the string to import.meta.glob(...) at build time, no runtime requests
  • @Collection(SchemaClass) field decorator — injects a reactive Resource<Entry<S>[]> into any component field
  • getCollection(SchemaClass) — loads all entries in parallel
  • getEntry(SchemaClass, slug) — loads only the single file matching the slug
  • getPage(SchemaClass, { page, pageSize }) — loads only the requested slice, files fetched in parallel; keys sorted for a stable order
  • getTotal(SchemaClass) — synchronous, counts glob keys without loading any file
  • @PagedCollection(SchemaClass, pagerField) — field decorator that wires a collection to any composable exposing page and pageSize (e.g. Pagination from @praxisjs/composables); re-fetches automatically when the page signal changes
  • Glob loading is lazy by default — each .md file becomes its own chunk
  • Runtime schema validation — fields are checked against default value types; missing or mistyped fields fall back to defaults with console.warn
  • Zero-dependency frontmatter YAML parser for string, number, boolean, and primitive arrays
  • marked for HTML rendering (pluggable via render option in CollectionConfig)
  • contentPlugin() Vite plugin exported from @praxisjs/content/vite
  • PageOptions type exported for use with getPage

On this page