Generate static artifacts
Use this path when your runtime needs files on disk — a CDN-only deploy, a static export, a separate agent-only service, or multiple sibling apps sharing one corpus. The leadtype generate CLI walks your MDX source and writes a complete set of files into public/.
If you'd rather render docs directly from your bundler, see the source primitive. For source-shape decisions (multi-folder, remote git, pinned refs), see Configure docs sources. For host-specific serving details, see Deploy generated artifacts.
The flow
Fetch the source repo
In CI, check out the docs source before the build. For a public repo, a shallow clone is enough:
For private repos, use your CI platform's checkout action or a read-only deploy key. The important part is that leadtype receives a normal filesystem path whose root contains docs/.
Lint before generate
Run lint against the fetched docs before writing generated output. Lint fails with file and line context, which is easier to debug than a later app build using stale artifacts:
Generate
Point --src at the fetched repo root and --out at the directory you'll serve:
That command writes:
public/llms.txtandpublic/llms-full.txtpublic/docs/*.mdpublic/docs/search-index.jsonandpublic/docs/search-content.jsonpublic/sitemap.xml,public/sitemap.md, andpublic/robots.txtpublic/docs/agent-readability.json- configured RSS/Atom feeds, such as
public/changelog/rss.xml
For feed-specific configuration and date rules, see Generate RSS and Atom feeds.
Use --json in CI so automation can record resolved groups, output files, filters, and search index stats.
Multi-source mounting
Some projects keep docs and release notes side by side instead of putting everything under docs/:
Repeat --docs-dir to include those folders in the same generated corpus:
By default, extra sources are mounted under /docs/<folder>, so changelog/v1.mdx becomes public/docs/changelog/v1.md and /docs/changelog/v1.md.
Use <dir>=<url-prefix> when the folder should keep its own public route:
That still keeps an internal generated copy at public/docs/changelog/v1.md for search and runtime helpers, but it also writes public/changelog/v1.md and emits canonical links such as /changelog/v1 and /changelog/v1.md in llms.txt, search metadata, sitemap entries, and agent-readability.json.
Add feeds in config when that mounted content should publish RSS or Atom:
Selected feed pages need stable frontmatter dates. Use explicit date values for changelogs and release notes. For pages where "updated at" should track source edits, default git enrichment writes lastModified when history is available. See Generate RSS and Atom feeds for the full feed contract.
Wire it into the build
Make checkout, lint, and generation run before the framework build:
If the docs source and docs app live in the same repo, skip docs:fetch and point --src at .:
Use library APIs for custom pipelines
The CLI is the happy path. Use the library APIs directly when you need custom plugin order, filters, or generated JSON paths. Keep conversion first — LLM files, search, and Agent Readability artifacts read the generated markdown:
Verify
After a clean build, inspect these files:
public/docs/index.md— converted markdown for the source repo home pagepublic/llms.txt— hosted routing index with page-level markdown linkspublic/llms-full.txt— all generated markdown docs in one fallback filepublic/docs/search-index.jsonandpublic/docs/search-content.json— non-empty search filespublic/docs/agent-readability.json— manifest for markdown responses, JSON-LD, sitemap, and robots helpers- configured feed files such as
public/changelog/rss.xmlandpublic/changelog/atom.xml