Content sources
Implement the small typed contract used by local files, remote MDX, and CMS adapters.
@foldocs/content defines the build-time content boundary independently of Vite
or the UI package.
Types
ContentFilecontains a stable path and source text.ContentAdapterloads a collection of files.ContentSource<Data>exposes typed records to adapter implementations.PageFrontmatter,TocItem, andPageMetadataare Effect schemas.
Define an adapter
import { defineContentAdapter } from '@foldocs/content'
export const adapter = defineContentAdapter('release-notes', async () => files)Validation
Decode unknown records at the adapter boundary. The Vite integration then rejects unsafe paths, duplicate ownership, and content that cannot compile.
Continue with local files or build a custom adapter.
Last updated 2 ago 2026