@praxisjs/content
Changelog for @praxisjs/content — markdown content collections with @Collection, ContentSchema, and Vite plugin.
@praxisjs/content
0.2.0
Add collectionStaticPaths(Schema) — builds a @praxisjs/ssg-compatible per-route getStaticPaths directly from a collection, substituting each entry's slug into the route's one dynamic segment. Removes the need to hand-write a getCollection(...).map(...) for the common case of a dynamic route backed 1:1 by a content collection; throws a clear error if the route path has zero or more than one dynamic segment.
0.1.10
peerDependencies.vite raised from >=7.0.0 to >=8.0.0, matching the Vite 8 requirement the rest of the ecosystem (@praxisjs/vite-plugin) already enforces. contentPlugin() itself has no Vite-version-specific behavior — this only corrects the declared range.
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