Static hosting
DocsLit builds a standard static site that you can deploy to any hosting provider. Run docslit build and upload the dist/ directory.
Build your site
This generates a dist/ directory with HTML pages, a search index, sitemap, and AI discovery files.
"url": "https://docs.example.com" to your docslit.json before building. This enables absolute URLs in your sitemap and llms.txt.Deploy recipes
Generate host-specific config files from the CLI:
For GitHub project sites (https://user.github.io/repo/), set "basePath": "/repo" in docslit.json so asset and navigation URLs stay correct.
Deploy to a hosting provider
This writes vercel.json, which sets the build command, the dist output directory and clean URLs, and middleware.js, which serves Markdown to AI agents that send Accept: text/markdown. Commit both files.
Run this from your project root, not from dist/:
Alternatively, connect your git repository to Vercel. It picks up the build command and output directory from vercel.json. If you deploy only the dist/ folder, the site works but Markdown negotiation does not, because Vercel reads middleware.js from the project root.
For continuous deployment, connect your repository and set the build command to docslit build with the publish directory set to dist.
Create .github/workflows/deploy.yml:
Go to your repository Settings > Pages and set the source to GitHub Actions.
Enable static website hosting on your S3 bucket and set index.html as the index document. Optionally, put CloudFront in front for HTTPS and caching.
Redirects and headers by host
Pattern redirects and the agent headers depend on files that only some hosts read.
| Host | Pattern redirects | Headers |
|---|---|---|
| Netlify | Yes, from _redirects |
Yes, from _headers |
| Cloudflare Pages | Yes, from _redirects |
Yes, from _headers |
| Vercel | Yes, from vercel.json |
Yes, from vercel.json |
| GitHub Pages | No. Exact redirects still work through HTML redirect pages | No |
Headers include noindex on .md files, the Link discovery header and Content-Signal. See How agents read your site and Redirects.
GitHub Pages runs Jekyll by default, which hides folders that start with a dot. The build writes an empty .nojekyll file so .well-known/, including agent.json and published skills, is served.
If you set basePath, .well-known/ sits under that subpath, where discovery tools that only check the domain root won't find it. See the limitation on the skills page.
What gets deployed
Every build produces these files:
| File | Purpose |
|---|---|
index.html |
Redirect to the first page, with a canonical link to it |
{slug}.html |
Pre-rendered pages for SEO |
{slug}.md |
Raw Markdown for programmatic access |
search-index.json |
Client-side full-text search |
sitemap.xml |
Search engine sitemap |
robots.txt |
Crawler directives |
llms.txt |
AI agent discovery index |
llms-full.txt |
Complete docs as plain text |
_middleware.js |
Content negotiation for AI agents (Cloudflare/Netlify) |
vercel.json |
Clean URLs, redirects, and headers for .md files and agent discovery (Vercel) |
_headers, _redirects |
Response headers and redirects (Netlify and Cloudflare Pages) |
.nojekyll |
Makes GitHub Pages serve the .well-known/ folder |
.well-known/agent.json |
Machine-readable agent discovery |
mcp-server.js |
MCP server for AI tool integration |
pdf/ |
Chapter, page, and full documentation PDFs (when built with --pdf) |
docslit build --pdf to generate downloadable PDF manuals alongside your HTML site. See Chapter PDF export.Custom output directory
Use the --out flag to change the output directory: