@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.
ContentSchemabase 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 toimport.meta.glob(...)at build time, no runtime requests@Collection(SchemaClass)field decorator — injects a reactiveResource<Entry<S>[]>into any component fieldgetCollection(SchemaClass)— loads all entries in parallelgetEntry(SchemaClass, slug)— loads only the single file matching the sluggetPage(SchemaClass, { page, pageSize })— loads only the requested slice, files fetched in parallel; keys sorted for a stable ordergetTotal(SchemaClass)— synchronous, counts glob keys without loading any file@PagedCollection(SchemaClass, pagerField)— field decorator that wires a collection to any composable exposingpageandpageSize(e.g.Paginationfrom@praxisjs/composables); re-fetches automatically when the page signal changes- Glob loading is lazy by default — each
.mdfile 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
markedfor HTML rendering (pluggable viarenderoption inCollectionConfig)contentPlugin()Vite plugin exported from@praxisjs/content/vitePageOptionstype exported for use withgetPage