Static hosting

Deployment•4 min read|
|

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

docslit build

This generates a dist/ directory with HTML pages, a search index, sitemap, and AI discovery files.

Add "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:

docslit deploy --github-pages docslit deploy --netlify docslit deploy --cloudflare docslit deploy --vercel

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

Install the Vercel CLI
npm install -g vercel
Write the Vercel files
docslit deploy --vercel

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.

Deploy

Run this from your project root, not from dist/:

vercel --prod

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.

Install the Netlify CLI
npm install -g netlify-cli
Deploy
docslit build netlify deploy --prod --dir=dist

For continuous deployment, connect your repository and set the build command to docslit build with the publish directory set to dist.

Add a GitHub Actions workflow

Create .github/workflows/deploy.yml:

name: Deploy docs on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest permissions: pages: write id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - run: npm install -g docslit - run: docslit build - uses: actions/upload-pages-artifact@v3 with: path: dist - uses: actions/deploy-pages@v4
Enable GitHub Pages

Go to your repository Settings > Pages and set the source to GitHub Actions.

Build and sync
docslit build aws s3 sync dist/ s3://your-bucket-name --delete
Configure static hosting

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)
Run 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:

docslit build --out public