@kimoxstudio/content
v0.2.1
Published
Content loading, routing and queries for kimox-fw documents.
Readme
@kimoxstudio/content
Content loading, routing and queries.
Reads PageDocuments and GlobalDocuments out of a GitProvider, with
caching, request coalescing and route↔path mapping.
import { createContentLoader } from "@kimoxstudio/content";
const loader = createContentLoader({ git, cache, content: config.content });
await loader.loadPage("/about"); // production branch
await loader.loadPage("/about", { variation: "kx/draft" });
await loader.queryPages({ prefix: "/blog", order: "desc", limit: 10 });Route mapping: / ↔ content/pages/index.json, /foo/bar ↔
content/pages/foo/bar.json. Files whose basename starts with _ are hidden
from listings. Production entries are cached until a webhook invalidates them;
variation reads use a short TTL.
Part of kimox-fw
kimox-fw is a JSON-document + template site framework for Next.js (App Router): pages are declarative JSON documents rendered by Zod-typed templates, with content stored in git and edited through a visual admin using draft branches ("variations").
Scaffold a whole site with npx create-kx-app.
MIT © Kimox Studio
